Limit generation numbers to 0 to 65535.

This commit is contained in:
Michael R Sweet
2025-07-28 12:51:39 +01:00
parent f9ff913bb9
commit 7ce8ec07ab
2 changed files with 8 additions and 1 deletions

View File

@ -20,6 +20,13 @@ v1.6.0 - YYYY-MM-DD
(Issue #104)
v1.5.4 - YYYY-MM-DD
-------------------
- Updated indirect reference reading code to limit the range of generation
numbers.
v1.5.3 - 2025-05-03
-------------------

View File

@ -515,7 +515,7 @@ _pdfioValueRead(pdfio_file_t *pdf, // I - PDF file
// Integer...
long generation = 0; // Generation number
while (tempptr < tb->bufend && isdigit(*tempptr & 255))
while (tempptr < tb->bufend && generation < 65536 && isdigit(*tempptr & 255))
{
generation = generation * 10 + *tempptr - '0';
tempptr ++;