com php-src: Fix bug #77988 - heap-buffer-overflow on php_jpg_get16: NEWS ext/exif/exif.c ext/exif/ tests/bug77988.jpg ext/exif/tests/bug7798 8.phpt

From: Date: Tue, 28 May 2019 00:28:09 +0000
Subject: com php-src: Fix bug #77988 - heap-buffer-overflow on php_jpg_get16: NEWS ext/exif/exif.c ext/exif/ tests/bug77988.jpg ext/exif/tests/bug7798 8.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-106361@lists.php.net to get a copy of this message
Commit: 73ff4193be24192c894dc0502d06e2b2db35eefb Author: Stanislav Malyshev <stas@php.net> Mon, 27 May 2019 17:16:29 -0700 Parents: 16e037bd46359a31f218ee220ff09f1c3270e489 Branches: PHP-7.1 PHP-7.2 PHP-7.3 PHP-7.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=73ff4193be24192c894dc0502d06e2b2db35eefb Log: Fix bug #77988 - heap-buffer-overflow on php_jpg_get16 Bugs: https://bugs.php.net/77988 Changed paths: M NEWS M ext/exif/exif.c A ext/exif/tests/bug77988.jpg A ext/exif/tests/bug77988.phpt Diff: diff --git a/NEWS b/NEWS index ea27c53..f771d20 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2019, PHP 7.1.30 +- EXIF: + . Fixed bug #77988 (heap-buffer-overflow on php_jpg_get16). + (CVE-2019-11040) (Stas) + - GD: . Fixed bug #77973 (Uninitialized read in gdImageCreateFromXbm). (CVE-2019-11038) (cmb) @@ -12,11 +16,11 @@ PHP NEWS 03 May 2019, PHP 7.1.29 -- EXIF +- EXIF: . Fixed bug #77950 (Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG). (CVE-2019-11036) (Stas) -- Mail +- Mail: .. Fixed bug #77821 (Potential heap corruption in TSendMail()). (cmb) 04 Apr 2019, PHP 7.1.28 diff --git a/ext/exif/exif.c b/ext/exif/exif.c index d174def..605b379 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -3526,6 +3526,8 @@ static int exif_scan_thumbnail(image_info_type *ImageInfo) if (c == 0xFF) return FALSE; marker = c; + if (pos>=ImageInfo->Thumbnail.size) + return FALSE; length = php_jpg_get16(data+pos); if (length > ImageInfo->Thumbnail.size || pos >= ImageInfo->Thumbnail.size - length) { return FALSE; diff --git a/ext/exif/tests/bug77988.jpg b/ext/exif/tests/bug77988.jpg new file mode 100644 index 0000000..120ff85 Binary files /dev/null and b/ext/exif/tests/bug77988.jpg differ diff --git a/ext/exif/tests/bug77988.phpt b/ext/exif/tests/bug77988.phpt new file mode 100644 index 0000000..1632c8a --- /dev/null +++ b/ext/exif/tests/bug77988.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #77988 (heap-buffer-overflow on php_jpg_get16) +--SKIPIF-- +<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?> +--FILE-- +<?php +exif_read_data(__DIR__."/bug77988.jpg", 'COMMENT', FALSE, TRUE); +?> +DONE +--EXPECTF-- +DONE \ No newline at end of file

« previous php.cvs (#106361) next »