[Bug libc/9914] possible signed integer overflow in libio/iogetdelim.c

drepper.fsp at gmail dot com sourceware-bugzilla@sourceware.org
Sat Oct 29 21:17:00 GMT 2011


http://sourceware.org/bugzilla/show_bug.cgi?id=9914

--- Comment #4 from Ulrich Drepper <drepper.fsp at gmail dot com> 2011-10-29 21:17:08 UTC ---
(In reply to comment #3)
> If it is testing whether cur_len + len + 1 overflowed from positive into
> negative, then it is undefined behavior, because all the additions are
> performed in signed _IO_ssize_t.

The compiler cannot know that the variables are not negative.  Therefore the
test has to be emitted.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the Glibc-bugs mailing list