This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/12701] New: scanf accepts non-matching input
- From: "bugdal at aerifal dot cx" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Mon, 25 Apr 2011 15:13:21 +0000
- Subject: [Bug libc/12701] New: scanf accepts non-matching input
- Auto-submitted: auto-generated
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.