#1477 closed defect (fixed)

_Objects_Set_name does not ensure NULL terminated string

Reported by: Joel Sherrill Owned by: Joel Sherrill
Priority: normal Milestone: 4.9
Component: score Version: 4.9
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

The code in the file cpukit/score/src/objectsetname.c does not ensure that the destination name string is null terminated. This error is apparent when using the dirty memory allocation configuration.

Index: score/src/objectsetname.c
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/score/src/objectsetname.c,v
retrieving revision 1.7
diff -u -r1.7 objectsetname.c
--- score/src/objectsetname.c 28 Sep 2009 23:00:20 -0000 1.7
+++ score/src/objectsetname.c 7 Dec 2009 17:21:11 -0000
@@ -53,6 +53,7 @@

}


strncpy( d, name, length );

+ d[length] = '\0';

the_object->name.name_p = d;

} else

#endif

Change History (2)

comment:1 Changed on Dec 7, 2009 at 4:23:40 PM by Joel Sherrill

Milestone: 4.104.9
Version: 4.84.9

comment:2 Changed on Dec 7, 2009 at 4:28:20 PM by Joel Sherrill

Resolution: fixed
Status: newclosed

Patch applied to 4.9 and CVS head.

Note: See TracTickets for help on using tickets.