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

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