This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]