Skip to content

Commit 73ff419

Browse files
committed
Fix bug #77988 - heap-buffer-overflow on php_jpg_get16
1 parent 16e037b commit 73ff419

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

NEWS

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

5+
- EXIF:
6+
. Fixed bug #77988 (heap-buffer-overflow on php_jpg_get16).
7+
(CVE-2019-11040) (Stas)
8+
59
- GD:
610
. Fixed bug #77973 (Uninitialized read in gdImageCreateFromXbm).
711
(CVE-2019-11038) (cmb)
@@ -12,11 +16,11 @@ PHP NEWS
1216

1317
03 May 2019, PHP 7.1.29
1418

15-
- EXIF
19+
- EXIF:
1620
. Fixed bug #77950 (Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG).
1721
(CVE-2019-11036) (Stas)
1822

19-
- Mail
23+
- Mail:
2024
. Fixed bug #77821 (Potential heap corruption in TSendMail()). (cmb)
2125

2226
04 Apr 2019, PHP 7.1.28

ext/exif/exif.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3526,6 +3526,8 @@ static int exif_scan_thumbnail(image_info_type *ImageInfo)
35263526
if (c == 0xFF)
35273527
return FALSE;
35283528
marker = c;
3529+
if (pos>=ImageInfo->Thumbnail.size)
3530+
return FALSE;
35293531
length = php_jpg_get16(data+pos);
35303532
if (length > ImageInfo->Thumbnail.size || pos >= ImageInfo->Thumbnail.size - length) {
35313533
return FALSE;

ext/exif/tests/bug77988.jpg

1.17 KB
Loading

ext/exif/tests/bug77988.phpt

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

0 commit comments

Comments
 (0)