public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/12701] New: scanf accepts non-matching input
@ 2011-04-25 15:13 bugdal at aerifal dot cx
  2011-05-02  1:40 ` [Bug libc/12701] " drepper.fsp at gmail dot com
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: bugdal at aerifal dot cx @ 2011-04-25 15:13 UTC (permalink / raw)
  To: glibc-bugs

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

           Summary: scanf accepts non-matching input
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: critical
          Priority: P2
         Component: libc
        AssignedTo: drepper.fsp@gmail.com
        ReportedBy: bugdal@aerifal.cx


glib'c scanf function incorrectly handles cases where it reads a sequence of
characters which are an initial subsequence of a matching sequence, but not
actually a matching sequence, for the conversion specifier. Examples include:

sscanf("abc", "%4c", buf) returns 1 instead of 0 or EOF (not sure which is
correct) and leaves no way for the caller to know buf[3] is unfilled.

sscanf("0xz", "%x%c", &x, &c) returns 2 instead of 0.

sscanf("1.0e+!", "%f%c", &x, &c) returns 2 instead of 0.

etc.

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


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-07-18 12:01 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-25 15:13 [Bug libc/12701] New: scanf accepts non-matching input bugdal at aerifal dot cx
2011-05-02  1:40 ` [Bug libc/12701] " drepper.fsp at gmail dot com
2011-05-02  2:36 ` bugdal at aerifal dot cx
2011-05-03  0:31 ` drepper.fsp at gmail dot com
2011-05-03  0:40 ` bugdal at aerifal dot cx
2011-05-03  1:14 ` drepper.fsp at gmail dot com
2011-05-03  2:24 ` bugdal at aerifal dot cx
2011-09-25  4:42 ` bugdal at aerifal dot cx
2011-10-29 17:14 ` drepper.fsp at gmail dot com
2011-10-29 21:24 ` bugdal at aerifal dot cx
2011-10-29 21:37 ` drepper.fsp at gmail dot com
2011-10-29 22:04 ` ldv at altlinux dot org
2011-10-30  5:43 ` bugdal at aerifal dot cx
2012-02-21  2:12 ` [Bug stdio/12701] " jsm28 at gcc dot gnu.org
2012-03-17 20:39 ` bugdal at aerifal dot cx
2012-03-18 17:17 ` jsm28 at gcc dot gnu.org
2012-04-18  5:23 ` bugdal at aerifal dot cx
2012-11-26  8:26 ` allachan at au1 dot ibm.com
2014-06-13 14:54 ` fweimer at redhat dot com
2014-06-27 14:00 ` fweimer at redhat dot com
2021-02-10 19:30 ` bnnf-yellowbot at blurcompany dot com
2021-03-05 15:27 ` bnnf at yahoo dot com
2021-09-15  2:40 ` namboru at jasaseo dot one
2023-07-18 11:44 ` vincent-srcware at vinc17 dot net
2023-07-18 12:01 ` vincent-srcware at vinc17 dot net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).