buffer overflow in _bfd_XX_print_ce_compressed_pdata
authorAlan Modra <amodra@gmail.com>
Wed, 26 Oct 2022 07:20:29 +0000 (17:50 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 26 Oct 2022 07:26:38 +0000 (17:56 +1030)
More fuzzed fun.

* peXXigen.c (_bfd_XX_print_ce_compressed_pdata): Use smaller of
virt_size and bfd section size as limit of function table.

bfd/peXXigen.c

index c5a7f7bf7ac678d80a227bb95d948dc8b501c03f..0232a63d558105081c1e5eac6342ba71591613a5 100644 (file)
@@ -2026,6 +2026,8 @@ _bfd_XX_print_ce_compressed_pdata (bfd * abfd, void * vfile)
     }
 
   start = 0;
+  if (stop > datasize)
+    stop = datasize;
 
   for (i = start; i < stop; i += onaline)
     {