Broken realloc (was Re: Safe coding practices ...)

Martin Weitzel martin at mwtech.UUCP
Thu Jan 31 02:33:15 AEST 1991


In article <23975:Jan2516:36:5891 at kramden.acf.nyu.edu> brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
>Some versions of realloc() return the original pointer rather than 0 if
>they run out of memory. So you have to code the malloc()/bcopy()/free()
>sequence yourself if you want error checking.

What? This sounds like a VERY serious bug (same as if malloc silently
returned less memory than requested if there's not enough).

On which major C-Implementation(s) does the problem exist and why wasn't
it fixed if it isn't "hearsay"?

I'm really concerned. PLEASE NAME THE IMPLEMENTATIONS. I want to avoid
environments where even the simplest (known) bugs aren't fixed!!
-- 
Martin Weitzel, email: martin at mwtech.UUCP, voice: 49-(0)6151-6 56 83



More information about the Comp.bugs.4bsd.ucb-fixes mailing list