This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug sim/18273] sim: various cppcheck warnings
- From: "vapier at gentoo dot org" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Sun, 19 Apr 2015 05:48:06 +0000
- Subject: [Bug sim/18273] sim: various cppcheck warnings
- Auto-submitted: auto-generated
- References: <bug-18273-4717 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=18273
Mike Frysinger <vapier at gentoo dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |vapier at gentoo dot org
Component|binutils |sim
Version|2.26 (HEAD) |HEAD
Assignee|unassigned at sourceware dot org |vapier at gentoo dot org
Product|binutils |gdb
Target Milestone|--- |8.0
Summary|cppcheck meets sim - five |sim: various cppcheck
|bugs |warnings
--- Comment #1 from Mike Frysinger <vapier at gentoo dot org> ---
David Binderman also mentioned this warning:
[src/sim/common/sim-trace.c:1229]: (error) Dangerous usage of 'phase' (strncpy
doesn't always null-terminate it).
Source code is
strncpy (phase, phase_wo_colon, SIZE_PHASE);
strcat (phase, ":");
It might be worthwhile to make sure the string is always terminated.
Something like
strncpy (phase, phase_wo_colon, SIZE_PHASE);
phase[SIZE_PHASE-1] = '\0';
strcat (phase, ":");
--
You are receiving this mail because:
You are on the CC list for the bug.