diff options
author | Alan Modra <amodra@gmail.com> | 2022-09-15 20:45:57 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-09-16 13:05:41 +0930 |
commit | 839a4671a9c2468f2a1b745ec251e03249f66d11 (patch) | |
tree | 434413426721701f95f30714bf7da63736fb3d89 /bfd/pdb.c | |
parent | 8838766ad6cbfbb41e254f008f6536957e54740b (diff) | |
download | gdb-839a4671a9c2468f2a1b745ec251e03249f66d11.zip gdb-839a4671a9c2468f2a1b745ec251e03249f66d11.tar.gz gdb-839a4671a9c2468f2a1b745ec251e03249f66d11.tar.bz2 |
pdb sanity check block_size
* pdb.c (pdb_get_elt_at_index): Only allow block_size to be
512, 1024, 2048, or 4096.
Diffstat (limited to 'bfd/pdb.c')
-rw-r--r-- | bfd/pdb.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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. */ |