This is the mail archive of the libc-help@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]

Re: handling overflow in sbrk.


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.


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