diff options
author | Rich Felker <dalias@aerifal.cx> | 2015-10-08 22:03:53 +0000 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2015-10-08 22:10:09 +0000 |
commit | 7b9f57f207b51132f188f750161953b7baf32154 (patch) | |
tree | 38055088e85f9428998dd1d37381c18c6f1339ff /src/locale/setlocale.c | |
parent | dc97951402b499023ce877dd2438bce0840b2c26 (diff) | |
download | musl-7b9f57f207b51132f188f750161953b7baf32154.tar.gz musl-7b9f57f207b51132f188f750161953b7baf32154.tar.xz musl-7b9f57f207b51132f188f750161953b7baf32154.zip |
fix open_[w]memstream behavior when no writes take place
the specification for these functions requires that the buffer/size exposed to the caller be valid after any successful call to fflush or fclose on the stream. the implementation's approach is to update them only at flush time, but that misses the case where fflush or fclose is called without any writes having taken place, in which case the write flushing callback will not be called. to fix both the observable bug and the desired invariant, setup empty buffers at open time and fail the open operation if no memory is available.
Diffstat (limited to 'src/locale/setlocale.c')
0 files changed, 0 insertions, 0 deletions