public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
From: "john.m.kenny at outlook dot com" <sourceware-bugzilla@sourceware.org> 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 [thread overview] Message-ID: <bug-28932-131@http.sourceware.org/bugzilla/> (raw) https://sourceware.org/bugzilla/show_bug.cgi?id=28932 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. -- You are receiving this mail because: You are on the CC list for the bug.
next reply other threads:[~2022-03-01 5:01 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-03-01 5:01 john.m.kenny at outlook dot com [this message] 2022-03-01 9:06 ` [Bug stdio/28932] " schwab@linux-m68k.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-28932-131@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=glibc-bugs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).