Browse code

fuzz - 12131, 12132, 12205 - Speed up PDF parse speed for truncated (or otherwise malformed) PDFs.

Micah Snyder authored on 2019/01/23 03:20:56
Showing 1 changed files
... ...
@@ -245,9 +245,8 @@ static int find_stream_bounds(
245 245
         q = q2;
246 246
         q2 = cli_memstr(q, bytesleft2, "endstream", 9);
247 247
         if (!q2) {
248
-            /* Couldn't find "endstream", but that's ok --
249
-             * -- we'll just count the data we have until EOF. */
250
-            q2 = q + bytesleft2-9; /* till EOF */
248
+            /* Couldn't find "endstream" */
249
+            return 0;
251 250
         }
252 251
 
253 252
         *endstream = q2 - start;