binutils/binutils-CVE-2023-1972.patch
Nick Clifton 184c1812b1 Spec File: Fix typo. (#2186396)
BFD library: Fix illegal memory access when loading corrupt symbol version info.  (#2186579)
2023-04-17 17:20:54 +01:00

21 lines
797 B
Diff

--- binutils.orig/bfd/elf.c 2023-04-17 16:26:08.720347439 +0100
+++ binutils-2.40/bfd/elf.c 2023-04-17 16:28:03.286317601 +0100
@@ -9050,6 +9050,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd
bfd_set_error (bfd_error_file_too_big);
goto error_return_verdef;
}
+ if (amt == 0)
+ goto error_return_verdef;
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
if (elf_tdata (abfd)->verdef == NULL)
goto error_return_verdef;
@@ -9153,6 +9155,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd
bfd_set_error (bfd_error_file_too_big);
goto error_return;
}
+ if (amt == 0)
+ goto error_return;
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
if (elf_tdata (abfd)->verdef == NULL)
goto error_return;