mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-18 08:38:10 +08:00
Fix an attempt to allocate an unreasonably large amount of memory when parsing a corrupt ELF file.
PR 29924 * objdump.c (load_specific_debug_section): Check for excessively large sections.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2022-12-21 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
PR 29924
|
||||||
|
* objdump.c (load_specific_debug_section): Check for excessively
|
||||||
|
large sections.
|
||||||
|
|
||||||
2022-12-19 Tom Tromey <tromey@adacore.com>
|
2022-12-19 Tom Tromey <tromey@adacore.com>
|
||||||
|
|
||||||
* dwarf-mode.el (dwarf-do-refresh): Avoid compiler warning.
|
* dwarf-mode.el (dwarf-do-refresh): Avoid compiler warning.
|
||||||
|
@ -4225,7 +4225,9 @@ load_specific_debug_section (enum dwarf_section_display_enum debug,
|
|||||||
section->size = bfd_section_size (sec);
|
section->size = bfd_section_size (sec);
|
||||||
/* PR 24360: On 32-bit hosts sizeof (size_t) < sizeof (bfd_size_type). */
|
/* PR 24360: On 32-bit hosts sizeof (size_t) < sizeof (bfd_size_type). */
|
||||||
alloced = amt = section->size + 1;
|
alloced = amt = section->size + 1;
|
||||||
if (alloced != amt || alloced == 0)
|
if (alloced != amt
|
||||||
|
|| alloced == 0
|
||||||
|
|| (bfd_get_size (abfd) != 0 && alloced >= bfd_get_size (abfd)))
|
||||||
{
|
{
|
||||||
section->start = NULL;
|
section->start = NULL;
|
||||||
free_debug_section (debug);
|
free_debug_section (debug);
|
||||||
|
Reference in New Issue
Block a user