[Bug other/60548] New: [libvtv/scripts/sum-vtv-counts.c:108]: (warning) scanf without field width limit s can crash with huge input data.
dcb314 at hotmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Mar 17 08:10:00 GMT 2014
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)
More information about the Gcc-bugs
mailing list