From 5b08046eced887279dd64e0effbdbd21b0245e38 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 24 Apr 2025 13:17:31 -0400 Subject: [PATCH] Add more range checking for streams. --- pdfio-stream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdfio-stream.c b/pdfio-stream.c index e4e6703..808e454 100644 --- a/pdfio-stream.c +++ b/pdfio-stream.c @@ -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;