This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
printf bug
- From: "David Shmelzer" <daves at pmdcorp dot com>
- To: <newlib at sources dot redhat dot com>
- Date: Fri, 22 Jan 2010 17:10:23 -0500
- Subject: printf bug
Hi,
The *may* be a bug in printf.
printf() does not return an error when printing a floating point value
when there is no heap left.
The library source file, dtoa.c, does not check for a NULL return value
of the malloc call as shown here:
_REENT_MP_RESULT(ptr) = Balloc (ptr, _REENT_MP_RESULT_K(ptr));
s = s0 = (char *) _REENT_MP_RESULT(ptr);
... s and s0 are not checked before used.
Dave