Skip to content

Commit f22101c

Browse files
smalyshevcmb69
authored andcommitted
Fix bug #78222 (heap-buffer-overflow on exif_scan_thumbnail)
(cherry picked from commit dea2989)
1 parent d561a99 commit f22101c

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 7.3.8
44

5+
- EXIF:
6+
. Fixed bug #78222 (heap-buffer-overflow on exif_scan_thumbnail).
7+
(CVE-2019-11041) (Stas)
8+
59
- OPcache:
610
. Fixed bug #78341 (Failure to detect smart branch in DFA pass). (Nikita)
711

ext/exif/exif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3892,7 +3892,7 @@ static int exif_scan_thumbnail(image_info_type *ImageInfo)
38923892
size_t length=2, pos=0;
38933893
jpeg_sof_info sof_info;
38943894

3895-
if (!data) {
3895+
if (!data || ImageInfo->Thumbnail.size < 4) {
38963896
return FALSE; /* nothing to do here */
38973897
}
38983898
if (memcmp(data, "\xFF\xD8\xFF", 3)) {

ext/exif/tests/bug78222.jpg

91 Bytes
Loading

ext/exif/tests/bug78222.phpt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--TEST--
2+
Bug #78222 (heap-buffer-overflow on exif_scan_thumbnail)
3+
--SKIPIF--
4+
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
5+
--FILE--
6+
<?php
7+
exif_read_data(__DIR__."/bug78222.jpg", 'THUMBNAIL', FALSE, TRUE);
8+
?>
9+
DONE
10+
--EXPECTF--
11+
DONE

0 commit comments

Comments
 (0)