4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-16 19:40:07 +08:00
Jeff Johnston 05272960ab 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.
2016-12-15 12:12:31 -05:00
..
2015-12-08 21:23:22 +01:00
2015-12-08 21:23:22 +01:00
2015-12-08 21:23:22 +01:00
2015-11-02 16:34:49 -05:00
2015-11-02 16:34:49 -05:00
2015-07-02 09:38:06 +02:00
2016-03-12 23:37:01 +01:00
2016-07-04 17:13:55 +01:00
2015-07-02 09:38:06 +02:00
2011-06-14 03:56:05 +00:00