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

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


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.


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