This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug stdio/14771] add length sanity check to snprintf
- From: "bugdal at aerifal dot cx" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 08 Oct 2013 23:07:28 +0000
- Subject: [Bug stdio/14771] add length sanity check to snprintf
- Auto-submitted: auto-generated
- References: <bug-14771-131 at http dot sourceware dot org/bugzilla/>
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.