exif add simple assert into jpeg header parsing as safety net more in a context of a possible text change. follow-up on GH-10402.

Close GH-10416.
This commit is contained in:
David Carlier 2023-01-22 19:03:36 +00:00
parent 256a34ed15
commit 1ab5d35bde

View File

@ -3805,6 +3805,9 @@ static bool exif_scan_JPEG_header(image_info_type *ImageInfo)
fpos = php_stream_tell(ImageInfo->infile); fpos = php_stream_tell(ImageInfo->infile);
/* safety net in case the above algorithm change dramatically, should not trigger */
ZEND_ASSERT(marker != 0xff);
/* Read the length of the section. */ /* Read the length of the section. */
if ((lh = php_stream_getc(ImageInfo->infile)) == (unsigned int)EOF) { if ((lh = php_stream_getc(ImageInfo->infile)) == (unsigned int)EOF) {
EXIF_ERRLOG_CORRUPT(ImageInfo) EXIF_ERRLOG_CORRUPT(ImageInfo)