* readelf.c (print_gnu_build_attribute_name): Read byte values
from the name string as unsigned bytes.
(process_notes_at): Use memcpy to copy an unterminated name
string.
+2017-03-06 Nick Clifton <nickc@redhat.com>
+
+ * readelf.c (print_gnu_build_attribute_name): Read byte values
+ from the name string as unsigned bytes.
+ (process_notes_at): Use memcpy to copy an unterminated name
+ string.
+
2017-03-06 Sam Thursfield <sam.thursfield@codethink.co.uk>
* configure.ac (AC_CHECK_DECLS): Add asprintf.
while (bytes --)
{
- val |= ((* name ++) << shift);
+ unsigned long byte = (* name ++) & 0xff;
+
+ val |= byte << shift;
shift += 8;
}
break;
}
- strncpy (temp, inote.namedata, inote.namesz);
+ memcpy (temp, inote.namedata, inote.namesz);
temp[inote.namesz] = 0;
/* warn (_("'%s' NOTE name not properly null terminated\n"), temp); */