This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/60548] New: [libvtv/scripts/sum-vtv-counts.c:108]: (warning) scanf without field width limit s can crash with huge input data.
- From: "dcb314 at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 17 Mar 2014 08:10:06 +0000
- Subject: [Bug other/60548] New: [libvtv/scripts/sum-vtv-counts.c:108]: (warning) scanf without field width limit s can crash with huge input data.
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60548
Bug ID: 60548
Summary: [libvtv/scripts/sum-vtv-counts.c:108]: (warning) scanf
without field width limit s can crash with huge input
data.
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Source code is
while (fscanf (fp_in, "%s %d %d %d %d %d\n", fname_in, &total,
&verified, ®set, ®pair, &unused) != EOF)
but
char fname_in[1024];
Maybe better code might be
while (fscanf (fp_in, "%1024s %d %d %d %d %d\n", fname_in, &total,
&verified, ®set, ®pair, &unused) != EOF)