commit - aa40560780b0cbea24d03b68570f3aac3b352da5
commit + dd3c8e62ac41add9bad416af8b71cc5db02de029
blob - 14e4a1da670fc0f1db89b2baf1e3047482adba13
blob + 4e159a39308ae3a089a6319e3e6227172b84d5a8
--- pdf.c
+++ pdf.c
* is a "linearized" PDF. in that case there should be exactly
* one xref section at the beginning of the file that is
* allowed to point forward.
+ * also, the new offset should not point outside the file.
*/
if ((uint64_t)tok->sint >= offset)
nfwd++;
offset);
break;
}
+ if ((uint64_t)tok->sint >= sz) {
+ log_message(5, "%s: /Prev pointer of xref section at "
+ "%zu (%#zx) points outside the file\n", infile,
+ offset, offset);
+ break;
+ }
offset = (size_t)tok->sint;
}