From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B78E73858C3A; Tue, 1 Mar 2022 05:01:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B78E73858C3A From: "john.m.kenny at outlook dot com" To: glibc-bugs@sourceware.org Subject: [Bug stdio/28932] New: scanf "%n" incorrectly requires int pointer, instead of size_t pointer Date: Tue, 01 Mar 2022 05:01:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: stdio X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: john.m.kenny at outlook dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2022 05:01:38 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28932 Bug ID: 28932 Summary: scanf "%n" incorrectly requires int pointer, instead of size_t pointer Product: glibc Version: unspecified Status: UNCONFIRMED Severity: minor Priority: P2 Component: stdio Assignee: unassigned at sourceware dot org Reporter: john.m.kenny at outlook dot com Target Milestone: --- The scanf function's conversion specifier "%n" requires the next pointer to= be a pointer to an int. That int gets "the number of characters consumed thus= far from the input". However, an int may not be large enough to read the number= of chars read. Previous programmers have identified this issue and resolved it by using a size_t. As evidence, the strlen(3) function returns a size_t and not an int. The fix: make the require pointer for the "%n" conversion specifier a size_t pointer instead of an int. --=20 You are receiving this mail because: You are on the CC list for the bug.=