[Bug malloc/14483] obstack uses int for allocation sizes

fweimer at redhat dot com sourceware-bugzilla@sourceware.org
Mon Aug 4 11:19:00 GMT 2014


https://sourceware.org/bugzilla/show_bug.cgi?id=14483

--- Comment #4 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Alan Modra from comment #3)
> Using int for sizes in the current obstack code is also a security breach, a
> buffer overflow on steroids.  A default buffer of around 4k is seen as
> sufficiently large to write a 2G+ object..  This is true for both 32-bit and
> 64-bit targets.
> 
> See https://sourceware.org/bugzilla/show_bug.cgi?id=17133

I think this is a bug in the caller, not in obstack.  But it's an easy mistake
to make, and I consider the use of int for memory region sizes to be bad
practice which should be avoided.  Unfortunately, it's difficult to change
legacy APIs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



More information about the Glibc-bugs mailing list