diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2016-12-15 12:06:04 -0500 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2016-12-15 12:12:31 -0500 |
commit | 05272960abb77e1c53239683d4adc6077e5549ea (patch) | |
tree | 874f74fc86939b681e58cd7464f3691dc8409443 /newlib/libc/stdlib/strtod.c | |
parent | c549e953a95f9ea17899bfb1eb8146b02408325a (diff) | |
download | newlib-05272960abb77e1c53239683d4adc6077e5549ea.zip newlib-05272960abb77e1c53239683d4adc6077e5549ea.tar.gz newlib-05272960abb77e1c53239683d4adc6077e5549ea.tar.bz2 |
2016-12-15 Giuseppe Musumeci <giuseppe.musumeci@broadcom.com>
__sinit initialises some common file descriptors as line buffered and
relies on the first users of such FDs to call __smakebuf_r. If
__smakebuf_r realises there's no space for a buffer (malloc returns
NULL), it makes them unbuffered. However, while setting the __SNBF
bit, it doesn't clear the __SLBF bit in the flags. Depending on the
order in which functions check buffering flags in the FD, sometime
they assume it's line buffered (e.g. __sfvwrite_r), trashing
application memory that's not really been allocated to them.
This patch solves the problem by clearing the unbuffered/line buffered
flag when setting the line buffered/unbuffered flag.
Diffstat (limited to 'newlib/libc/stdlib/strtod.c')
0 files changed, 0 insertions, 0 deletions