diff options
author | Rich Felker <dalias@aerifal.cx> | 2015-12-19 23:43:31 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2015-12-19 23:43:31 -0500 |
commit | d87f0a9a95f0a1228ee5579e5822a8c93bc96823 (patch) | |
tree | 04e8b2769da6dfde2239e38ff7481001e0c34960 /dist | |
parent | 42216742cd69e52e70aeb1d14498a8145872de52 (diff) | |
download | musl-d87f0a9a95f0a1228ee5579e5822a8c93bc96823.tar.gz musl-d87f0a9a95f0a1228ee5579e5822a8c93bc96823.tar.xz musl-d87f0a9a95f0a1228ee5579e5822a8c93bc96823.zip |
avoid updating caller's size when getdelim fails to realloc
getdelim was updating *n, the caller's stored buffer size, before calling realloc. if getdelim then failed due to realloc failure, the caller would see in *n a value larger than the actual size of the allocated block, and use of that value is unsafe. in particular, passing it again to getdelim is unsafe. now, temporary storage is used for the desired new size, and *n is not written until realloc succeeds.
Diffstat (limited to 'dist')
0 files changed, 0 insertions, 0 deletions