public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] pdb sanity check block_size
@ 2022-09-16  3:39 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-09-16  3:39 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=839a4671a9c2468f2a1b745ec251e03249f66d11

commit 839a4671a9c2468f2a1b745ec251e03249f66d11
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Sep 15 20:45:57 2022 +0930

    pdb sanity check block_size
    
            * pdb.c (pdb_get_elt_at_index): Only allow block_size to be
            512, 1024, 2048, or 4096.

Diff:
---
 bfd/pdb.c | 7 +++++++
 1 file changed, 7 insertions(+)

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.  */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-16  3:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-16  3:39 [binutils-gdb] pdb sanity check block_size Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).