readelf: ubsan: shift exponent 32 is too large
When compiled on a 32-bit host, a temp var is too small for possible 64-bit values to be calculated. * readelf.c (print_gnu_build_attribute_name): Make "bytes" unsigned long long.
This commit is contained in:
parent
2781f857e6
commit
54b8331d0b
@ -1,3 +1,8 @@
|
||||
2020-08-30 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* readelf.c (print_gnu_build_attribute_name): Use unsigned long
|
||||
long for "bytes".
|
||||
|
||||
2020-08-28 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR 26548
|
||||
|
@ -19662,7 +19662,7 @@ print_gnu_build_attribute_name (Elf_Internal_Note * pnote)
|
||||
|
||||
while (bytes --)
|
||||
{
|
||||
unsigned long byte = (* name ++) & 0xff;
|
||||
unsigned long long byte = *name++ & 0xff;
|
||||
|
||||
val |= byte << shift;
|
||||
shift += 8;
|
||||
|
Loading…
Reference in New Issue
Block a user