memset() fails on negative byte value

Bug #1279700 reported by Geoff Streeter
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Raspbian
Expired
Undecided
Unassigned

Bug Description

I have logged this on github bavison/arm-mem which seems appropriate but may not be. In addition that seems to be an inactive site. This might expedite things.

memset() does not honour the "converted to an unsigned char" required by 7.21.6.1 of ISO/IEC 9899:1999(E)

signed char smallint = -3;
 signed char smallarray[10];

memset(smallarray, smallint, 10);

results in
 smallarray[0] ←→ -3
 smallarray[1] ←→ -1
 smallarray[2] ←→ -1
 smallarray[3] ←→ -1
 smallarray[4] ←→ -3
 ...
 code widens the smallint of -3 to int with sign extension - correctly. memset() fails to AND this with 0xff before shifting and ORing.

Revision history for this message
Diederik (didi-debian) wrote :

The reported issue, https://github.com/bavison/arm-mem/issues/1 , is fixed.
Does this bug still need to stay open?

Changed in raspbian:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Raspbian because there has been no activity for 60 days.]

Changed in raspbian:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.