This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug malloc/14483] obstack uses int for allocation sizes
- From: "fweimer at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Mon, 04 Aug 2014 11:19:39 +0000
- Subject: [Bug malloc/14483] obstack uses int for allocation sizes
- Auto-submitted: auto-generated
- References: <bug-14483-131 at http dot sourceware dot org/bugzilla/>
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.