Skip to content

Commit 45128f3

Browse files
committed
Merge branch 'pull-request/2275'
* pull-request/2275: Fix overrun in exif's "Illegal components" error message.
2 parents 032131f + 5440480 commit 45128f3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/exif/exif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3230,7 +3230,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
32303230
}
32313231

32323232
if (components <= 0) {
3233-
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal components(%ld)", tag, exif_get_tagname(tag, tagname, -12, tag_table), components);
3233+
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal components(%d)", tag, exif_get_tagname(tag, tagname, -12, tag_table), components);
32343234
return FALSE;
32353235
}
32363236

ext/exif/tests/bug73737.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Bug #73737 (Crash when parsing a tag format)
88
var_dump($exif);
99
?>
1010
--EXPECTF--
11-
Warning: exif_thumbnail(bug73737.tiff): Process tag(x0100=ImageWidth ): Illegal components(%i) in %s on line %d
11+
Warning: exif_thumbnail(bug73737.tiff): Process tag(x0100=ImageWidth ): Illegal components(0) in %s on line %d
1212

1313
Warning: exif_thumbnail(bug73737.tiff): Error in TIFF: filesize(x0030) less than start of IFD dir(x10102) in %s line %d
1414
bool(false)

0 commit comments

Comments
 (0)