mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
When decoding SLEB128, make sure sign extension is performed for
64-bit integers. MFC after: 3 days
This commit is contained in:
parent
61c2a6184e
commit
3254dc0a2b
2 changed files with 2 additions and 2 deletions
|
|
@ -192,7 +192,7 @@ dwarf_read_sleb128(Elf_Data **dp, uint64_t *offsetp)
|
|||
shift += 7;
|
||||
} while ((b & 0x80) != 0);
|
||||
|
||||
if (shift < 32 && (b & 0x40) != 0)
|
||||
if (shift < 64 && (b & 0x40) != 0)
|
||||
ret |= (-1 << shift);
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ dwarf_decode_sleb128(uint8_t **dp)
|
|||
shift += 7;
|
||||
} while ((b & 0x80) != 0);
|
||||
|
||||
if (shift < 32 && (b & 0x40) != 0)
|
||||
if (shift < 64 && (b & 0x40) != 0)
|
||||
ret |= (-1 << shift);
|
||||
|
||||
*dp = src;
|
||||
|
|
|
|||
Loading…
Reference in a new issue