projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8838766
)
pdb sanity check block_size
author
Alan Modra
<amodra@gmail.com>
Thu, 15 Sep 2022 11:15:57 +0000
(20:45 +0930)
committer
Alan Modra
<amodra@gmail.com>
Fri, 16 Sep 2022 03:35:41 +0000
(13:05 +0930)
* pdb.c (pdb_get_elt_at_index): Only allow block_size to be
512, 1024, 2048, or 4096.
bfd/pdb.c
patch
|
blob
|
history
diff --git
a/bfd/pdb.c
b/bfd/pdb.c
index 9a431c23b1fe0099665719e584068a6195a2237e..67d7e73c655704fb8a3c86793ba17dcc84f5eeba 100644
(file)
--- 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. */