mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-12-23 03:53:43 +01:00
tests: Use strtoul in test-coredump-unwind.c
Read the address using strtoul(). If strtol() is used and the number is bigger than LONG_MAX, LONG_MAX is returned instead, which leads to a failure if the mapping address is 0x80000000 or larger on 32-bit platforms (and similarly for 64-bit platforms).
This commit is contained in:
parent
4b63a536ee
commit
b707e13ca0
1 changed files with 1 additions and 1 deletions
|
@ -314,7 +314,7 @@ main(int argc UNUSED, char **argv)
|
|||
while (*argv)
|
||||
{
|
||||
char *colon;
|
||||
long vaddr = strtol(*argv, &colon, 16);
|
||||
unsigned long vaddr = strtoul(*argv, &colon, 16);
|
||||
if (*colon != ':')
|
||||
error_msg_and_die("Bad format: '%s'", *argv);
|
||||
if (_UCD_add_backing_file_at_vaddr(ui, vaddr, colon + 1) < 0)
|
||||
|
|
Loading…
Reference in a new issue