[Bug 6512] Data corruption caused by realloc()

bugzilla at busybox.net bugzilla at busybox.net
Wed Sep 25 20:29:16 UTC 2013


https://bugs.busybox.net/show_bug.cgi?id=6512

Svenning Sørensen <sss at secomea.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #2 from Svenning Sørensen <sss at secomea.com> 2013-09-25 20:29:15 UTC ---
OK, red herring.

I guess I was confused by the fact that the chunk pointer doesn't actually
point to the chunk, but is offset to point 4 bytes below, making the overhead
only 4 bytes instead of 8, as the struct layout made me think.

So, as the comment correctly states, the amount of user data in a chunk is
always an odd number of 'size_t's; testing for > 3 or > 4 (for example) is
equally correct, even though (to my own defense) it didn't seem so at first
glance.
At least the patch doesn't break anything :)

Dang, guess I'll have to look elsewhere for the cause of my weird memory
corruption..

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the uClibc-cvs mailing list