Limit generation numbers to 0 to 65535.

This commit is contained in:
Michael R Sweet
2025-07-28 12:51:17 +01:00
parent 4bbb8b0b38
commit d3a5fa9e0b
5 changed files with 22 additions and 15 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 ++;