handling overflow in sbrk.
Carlos O'Donell
carlos@systemhalted.org
Tue May 20 12:45:00 GMT 2008
On Sat, May 17, 2008 at 2:57 AM, Chris Demetriou <cgd@google.com> wrote:
> On the other hand, it's really easy to add a check for overflow in
> sbrk. If __curbrk + incr wraps the pointer, declare an error.
>
>
> See attached test program (sbrktest.c). Build for (32-bit) x86 and
> run on an x86-64 linux system, put text at 0xd0000000 so it's easy to
> wrap the break.
>
> What do y'all think?
>
> 2008-05-16 Chris Demetriou <cgd@google.com>
>
> * misc/sbrk.c (__sbrk): If incrementing __curbrk by the requested
> amount would cause it to overflow, return an error (ENOMEM).
>
1. Please add a test case for this bug. Converting your program into a
test would be a great idea.
2. Please run the glibc testsuite to verify that there were no regressions.
3. Do you have an FSF copyright assignment?
Cheers,
Carlos O'Donell.
More information about the Libc-help
mailing list