[Bug libc/13138] scanf crashes on very long numbers

bugdal at aerifal dot cx sourceware-bugzilla@sourceware.org
Sat Sep 3 05:09:00 GMT 2011


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

Rich Felker <bugdal at aerifal dot cx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugdal at aerifal dot cx

--- Comment #3 from Rich Felker <bugdal at aerifal dot cx> 2011-09-03 05:08:56 UTC ---
POSIX uses the more-clear language "or if the result of the conversion cannot
be represented in the space provided" rather than "... in the object". In
either case, I believe this is referring to string conversions that overflow
the destination buffer, not numeric conversions. I can't find any language
regarding what happens when a numeric value is outside the range of the type,
but the expected form is specified in terms of strtol, etc., so it would not be
unreasonable to expect scanf to behave the same as these functions.

By the way, can the bug be reproduced with a huge string of zeros? If so, the
numeric overflow issue is irrelevant and the behavior is definitely
well-defined by the standard.

-- 
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