mirror of
https://github.com/JakeHillion/drgn.git
synced 2024-12-23 01:33:06 +00:00
libdrgn: dwarf_index: fix DW_AT_strp bounds check
The string must be null terminated, so there must be at least one byte left in .debug_str. Signed-off-by: Omar Sandoval <osandov@osandov.com>
This commit is contained in:
parent
c4b174af74
commit
420d2bb1dc
@ -1461,7 +1461,7 @@ sibling:
|
||||
if ((err = binary_buffer_next_u64(&buffer->bb, &tmp)))
|
||||
return err;
|
||||
strp:
|
||||
if (tmp > debug_str->d_size) {
|
||||
if (tmp >= debug_str->d_size) {
|
||||
return binary_buffer_error(&buffer->bb,
|
||||
"DW_AT_name is out of bounds");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user