#1479 closed defect (fixed)

c/src/lib/libbsp/m68k/mvme167/fatal/bspfatal.c strcat abuse

Reported by: Ralf Corsepius Owned by: Joel Sherrill
Priority: normal Milestone: 4.10
Component: bsps Version: 4.10
Severity: major Keywords:
Cc: norume@… Blocked By:
Blocking:

Description

bsp_fatal_error_occurred() in c/src/lib/libbsp/m68k/mvme167/fatal/bspfatal.c is broken.

GCC even warns about it:

../../../../../../../../c/src/lib/libbsp/m68k/mvme167/fatal/bspfatal.c:52: warning: assignment makes integer from pointer without a cast
../../../../../../../../c/src/lib/libbsp/m68k/mvme167/fatal/bspfatal.c:58: warning: assignment makes integer from pointer without a cast
../../../../../../../../c/src/lib/libbsp/m68k/mvme167/fatal/bspfatal.c:64: warning: assignment makes integer from pointer without a cast
../../../../../../../../c/src/lib/libbsp/m68k/mvme167/fatal/bspfatal.c:70: warning: assignment makes integer from pointer without a cast
../../../../../../../../c/src/lib/libbsp/m68k/mvme167/fatal/bspfatal.c:76: warning: assignment makes integer from pointer without a cast
../../../../../../../../c/src/lib/libbsp/m68k/mvme167/fatal/bspfatal.c:83: warning: assignment makes integer from pointer without a cast
../../../../../../../../c/src/lib/libbsp/m68k/mvme167/fatal/bspfatal.c:87: warning: assignment makes integer from pointer without a cast

From what I gather, this code expects strcat to return the size of the string having been appended to a string. This does not apply to "strcat".

AFAIS, this bug was introduced by the patch having been added to CVS as release 1.8 (cvs diff -u -r 1.7 -r 1.8 bspfatal.c), ties to replace "mystrcat" with "strcat".

Attachments (1)

patch (2.5 KB) - added by Eric Norum on Dec 8, 2009 at 3:42:51 PM.
Patch to use strcat as intended.

Download all attachments as: .zip

Change History (2)

Changed on Dec 8, 2009 at 3:42:51 PM by Eric Norum

Attachment: patch added

Patch to use strcat as intended.

comment:1 Changed on Dec 8, 2009 at 3:48:46 PM by Joel Sherrill

Resolution: fixed
Status: newclosed

Committed and closed.

Thanks.

Note: See TracTickets for help on using tickets.