Skip to content

Commit 1ab5d35

Browse files
committed
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.
1 parent 256a34e commit 1ab5d35

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext/exif/exif.c

+3
Original file line numberDiff line numberDiff line change
@@ -3805,6 +3805,9 @@ static bool exif_scan_JPEG_header(image_info_type *ImageInfo)
38053805

38063806
fpos = php_stream_tell(ImageInfo->infile);
38073807

3808+
/* safety net in case the above algorithm change dramatically, should not trigger */
3809+
ZEND_ASSERT(marker != 0xff);
3810+
38083811
/* Read the length of the section. */
38093812
if ((lh = php_stream_getc(ImageInfo->infile)) == (unsigned int)EOF) {
38103813
EXIF_ERRLOG_CORRUPT(ImageInfo)

0 commit comments

Comments
 (0)