out of memory in Balloc

Joern RENNECKE joern.rennecke@st.com
Tue Aug 1 18:08:00 GMT 2006


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.



More information about the Newlib mailing list