Add more range checking for streams.

This commit is contained in:
Michael R Sweet 2025-04-24 13:17:31 -04:00
parent d1bf9a92dc
commit 5b08046ece
No known key found for this signature in database
GPG Key ID: BE67C75EC81F3244

View File

@ -270,7 +270,7 @@ _pdfioStreamCreate(
{
columns = 1;
}
else if (columns < 0)
else if (columns < 0 || columns > 65536)
{
_pdfioFileError(st->pdf, "Unsupported Columns value %d.", columns);
free(st);
@ -542,7 +542,7 @@ _pdfioStreamOpen(pdfio_obj_t *obj, // I - Object
{
columns = 1;
}
else if (columns < 0)
else if (columns < 0 || columns > 65536)
{
_pdfioFileError(st->pdf, "Unsupported Columns value %d.", columns);
goto error;