PR28543, readelf entered an infinite loop
authorAlan Modra <amodra@gmail.com>
Mon, 8 Nov 2021 22:32:22 +0000 (09:02 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 9 Nov 2021 22:50:10 +0000 (09:20 +1030)
This little tweak terminates fuzzed binary readelf output a little
quicker.

PR 28543
* dwarf.c (read_and_display_attr_value): Consume a byte when
form is unrecognized.

binutils/dwarf.c

index d80235fb206a4305a1b30f16db03cc03a432c8f3..ce54813a0763b39246ffcd29cfdf5d2e109f92bf 100644 (file)
@@ -2743,6 +2743,8 @@ read_and_display_attr_value (unsigned long           attribute,
       
     default:
       warn (_("Unrecognized form: 0x%lx\n"), form);
+      /* What to do?  Consume a byte maybe?  */
+      ++data;
       break;
     }