Browse code

0.100.x - tightening up off-by-one error in pdf string parsing.

Mickey Sola authored on 2018/02/17 03:51:52
Showing 1 changed files
... ...
@@ -591,7 +591,7 @@ char *pdf_parse_string(struct pdf_struct *pdf, struct pdf_obj *obj, const char *
591 591
     /* Make a best effort to find the end of the string and determine if UTF-* */
592 592
     p2 = ++p1;
593 593
     if (!str) {
594
-        checklen = cli_strnlen(p1, objsize) + 1;
594
+        checklen = cli_strnlen(p1, objsize - 1) + 1;
595 595
     }
596 596
     else {
597 597
         checklen = cli_strnlen(p1, checklen) + 1;