mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 12:03:41 +08:00
Prevent an over large memory allocation in readelf when parsing a corrupt DWARF file.
PR 30227 * dwarf.c (process_cu_tu_index): Prevent excessive memory allocation when nused is large and ncols is zero.
This commit is contained in:
parent
ff581559f9
commit
97b75c421f
@ -1,3 +1,9 @@
|
||||
2023-03-14 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR 30227
|
||||
* dwarf.c (process_cu_tu_index): Prevent excessive memory
|
||||
allocation when nused is large and ncols is zero.
|
||||
|
||||
2023-02-09 Tom Tromey <tromey@adacore.com>
|
||||
|
||||
* dwarf-mode.el: Bump version to 1.8.
|
||||
|
@ -10912,6 +10912,9 @@ process_cu_tu_index (struct dwarf_section *section, int do_display)
|
||||
if (nused == -1u
|
||||
|| _mul_overflow ((size_t) ncols, 4, &temp)
|
||||
|| _mul_overflow ((size_t) nused + 1, temp, &total)
|
||||
|| total > (size_t) (limit - ppool)
|
||||
/* PR 30227: ncols could be 0. */
|
||||
|| _mul_overflow ((size_t) nused + 1, 4, &total)
|
||||
|| total > (size_t) (limit - ppool))
|
||||
{
|
||||
warn (_("Section %s too small for offset and size tables\n"),
|
||||
|
Loading…
Reference in New Issue
Block a user