This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
out of memory in Balloc
- From: Joern RENNECKE <joern dot rennecke at st dot com>
- To: newlib at sourceware dot org
- Date: Tue, 01 Aug 2006 16:20:33 +0100
- Subject: out of memory in Balloc
When mprec.c, dtoa.c or strtod.c, ldtoa.c or gdtoa-gethex.c calls
balloc, it does not check the return value.
Thus, when we run out of memory, and memory at 0 can be accessed, the
program will run on for a while
and later fail with an obscure failure.
I'm not sure how to best handle this - should we call abort then, or
would this cause to much other code to
be dragged in? If the latter is the case, then I think an infinite
loops is still better than memory corruption.
Since none of the callers to Balloc in newlib checks the return value, I
suppose an abort call, if any, should
be placed in Balloc instead of returning NULL there.