about summary refs log tree commit diff
path: root/include/net
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015-12-19 23:43:31 -0500
committerRich Felker <dalias@aerifal.cx>2015-12-19 23:43:31 -0500
commitd87f0a9a95f0a1228ee5579e5822a8c93bc96823 (patch)
tree04e8b2769da6dfde2239e38ff7481001e0c34960 /include/net
parent42216742cd69e52e70aeb1d14498a8145872de52 (diff)
downloadmusl-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 'include/net')
0 files changed, 0 insertions, 0 deletions