... | ... |
@@ -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; |