mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 11:00:01 +08:00
PR28415, invalid read in xtensa_read_table_entries
PR 28415 PR 28416 * elf32-xtensa.c (xtensa_read_table_entries): Handle error return from retrieve_contents.
This commit is contained in:

committed by
Alan Modra

parent
851a4f24d7
commit
0161bdd47c
@ -910,7 +910,14 @@ xtensa_read_table_entries (bfd *abfd,
|
|||||||
table_entry_size -= 4;
|
table_entry_size -= 4;
|
||||||
|
|
||||||
num_records = table_size / table_entry_size;
|
num_records = table_size / table_entry_size;
|
||||||
|
|
||||||
table_data = retrieve_contents (abfd, table_section, true);
|
table_data = retrieve_contents (abfd, table_section, true);
|
||||||
|
if (table_data == NULL)
|
||||||
|
{
|
||||||
|
*table_p = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
blocks = (property_table_entry *)
|
blocks = (property_table_entry *)
|
||||||
bfd_malloc (num_records * sizeof (property_table_entry));
|
bfd_malloc (num_records * sizeof (property_table_entry));
|
||||||
block_count = 0;
|
block_count = 0;
|
||||||
|
Reference in New Issue
Block a user