From: Alan Modra Date: Thu, 15 Sep 2022 11:15:57 +0000 (+0930) Subject: pdb sanity check block_size X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=839a4671a9c2468f2a1b745ec251e03249f66d11;p=binutils-gdb.git pdb sanity check block_size * pdb.c (pdb_get_elt_at_index): Only allow block_size to be 512, 1024, 2048, or 4096. --- diff --git a/bfd/pdb.c b/bfd/pdb.c index 9a431c23b1f..67d7e73c655 100644 --- a/bfd/pdb.c +++ b/bfd/pdb.c @@ -79,6 +79,13 @@ pdb_get_elt_at_index (bfd *abfd, symindex sym_index) } block_size = bfd_getl32 (int_buf); + if ((block_size & -block_size) != block_size + || block_size < 512 + || block_size > 4096) + { + bfd_set_error (bfd_error_malformed_archive); + return NULL; + } /* Get block_map_addr. */