From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74382 invoked by alias); 19 Apr 2015 05:48:16 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 73694 invoked by uid 48); 19 Apr 2015 05:48:13 -0000 From: "vapier at gentoo dot org" To: gdb-prs@sourceware.org Subject: [Bug sim/18273] sim: various cppcheck warnings Date: Sun, 19 Apr 2015 05:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: sim X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vapier at gentoo dot org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: vapier at gentoo dot org X-Bugzilla-Target-Milestone: 8.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc component version assigned_to product target_milestone short_desc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-q2/txt/msg00068.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=18273 Mike Frysinger 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 --- 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.