dump: Title section sometimes has 0x31 plus fixed block in place of 0x58.
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 27 Jul 2015 05:04:59 +0000 (22:04 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 27 Jul 2015 05:07:12 +0000 (22:07 -0700)
dump.c

diff --git a/dump.c b/dump.c
index a7ccbdc88b1cbb1facd1b19015a1fdfdbf13f229..140050d6cba84956d5bd32ff594f2d7fe1baa664 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -280,7 +280,25 @@ dump_value_31(FILE *stream)
             }
           else
             match_byte_assert(0x58);
-          match_byte_assert(0x58);
+          if (match_byte(0x31))
+            {
+              /* All the examples in the corpus, all from one SPV file, are
+                 exactly like this. */
+              match_u32_assert(0);
+              match_u32_assert(0);
+              match_u32_assert(0);
+              match_u32_assert(0);
+              match_byte_assert(1);
+              match_byte_assert(0);
+              match_byte_assert(8);
+              match_byte_assert(0);
+              match_byte_assert(8);
+              match_byte_assert(0);
+              match_byte_assert(10);
+              match_byte_assert(0);
+            }
+          else
+            match_byte_assert(0x58);
           if (pos != outer_end)
             {
               fprintf(stderr, "outer end discrepancy\n");