harden realloc/free to detect simple overflows
authorRich Felker <dalias@aerifal.cx>
Sat, 20 Jul 2013 00:00:11 +0000 (20:00 -0400)
committerRich Felker <dalias@aerifal.cx>
Sat, 20 Jul 2013 00:00:11 +0000 (20:00 -0400)
the sizes in the header and footer for a chunk should always match. if
they don't, the program has definitely invoked undefined behavior, and
the most likely cause is a simple overflow, either of a buffer in the
block being freed or the one just below it.

crashing here should not only improve security of buggy programs, but
also aid in debugging, since the crash happens in a context where you
have a pointer to the likely-overflowed buffer.


No differences found