[Bug stdio/14771] add length sanity check to snprintf

bugdal at aerifal dot cx sourceware-bugzilla@sourceware.org
Tue Oct 8 23:07:00 GMT 2013


https://sourceware.org/bugzilla/show_bug.cgi?id=14771

Rich Felker <bugdal at aerifal dot cx> changed:

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

--- Comment #2 from Rich Felker <bugdal at aerifal dot cx> ---
snprintf is required by POSIX to return a negative value and set errno to
EOVERFLOW if the n argument is greater than INT_MAX. Actually I find it
difficult to see how this requirement is compatible with ISO C, which makes no
such requirement or allowance for what would otherwise be a spurious error, so
perhaps this should be filed as a bug against POSIX; an interpretation is
needed, at least. But assuming the requirement in POSIX stands, it's a bug for
glibc not to report an error when n is greater than INT_MAX.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



More information about the Glibc-bugs mailing list