From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10760 invoked by alias); 2 May 2011 02:36:12 -0000 Received: (qmail 10541 invoked by uid 22791); 2 May 2011 02:36:11 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 02 May 2011 02:35:58 +0000 From: "bugdal at aerifal dot cx" To: glibc-bugs@sources.redhat.com Subject: [Bug libc/12701] scanf accepts non-matching input X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: bugdal at aerifal dot cx X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: drepper.fsp at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Resolution Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Mon, 02 May 2011 02:36:00 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00002.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=3D12701 Rich Felker changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|INVALID | --- Comment #2 from Rich Felker 2011-05-02 02:35= :40 UTC --- They are not correctly handled. Please refer to C99, 7.19.6.2, paragraph 9, which defines an input item as: "the longest sequence of input characters which does not exceed any speci= =EF=AC=81ed =EF=AC=81eld width and which is, or is a pre=EF=AC=81x of, a matching input= sequence" Paragraph 10 then reads: "If the input item is not a matching sequence, the execution of the directi= ve fails: this condition is a matching failure." Clearly in the case of sscanf("0xz", "%x%c", &x, &c), the first "input item= " is "0x", and it is not a matching sequence for the %x conversion (see the specification of strtoul, in terms of which scanf %x is specified), so the result must be a matching failure. If you're going to wrongly mark this bug as "RESOLVED", at least mark it "WONTFIX" rather than "INVALID" and acknowledge that it's a bug that you're unwilling to fix, and that glibc is intentionally non-conformant in this matter. --=20 Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=3Demail ------- You are receiving this mail because: ------- You are on the CC list for the bug.