mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
Add a sanity check: The provided offset for the desired location list
should not exceed the size of the .debug_loc section.
This commit is contained in:
parent
9c016dc4b2
commit
255d921adc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/projects/elftoolchain/; revision=260878
@ -127,6 +127,11 @@ _dwarf_loclist_add(Dwarf_Debug dbg, Dwarf_CU cu, uint64_t lloff,
|
||||
return (DW_DLE_NO_ENTRY);
|
||||
}
|
||||
|
||||
if (lloff >= ds->ds_size) {
|
||||
DWARF_SET_ERROR(dbg, error, DW_DLE_NO_ENTRY);
|
||||
return (DW_DLE_NO_ENTRY);
|
||||
}
|
||||
|
||||
if ((ll = malloc(sizeof(struct _Dwarf_Loclist))) == NULL) {
|
||||
DWARF_SET_ERROR(dbg, error, DW_DLE_MEMORY);
|
||||
return (DW_DLE_MEMORY);
|
||||
|
Loading…
Reference in New Issue
Block a user