Merge branch 'PHP-7.2' into PHP-7.3

This commit is contained in:
Nikita Popov 2019-02-12 09:28:47 +01:00
commit c553d17f11
4 changed files with 25 additions and 0 deletions

3
NEWS
View file

@ -14,6 +14,9 @@ PHP NEWS
. Fixed bug #77530 (PHP crashes when parsing `(2)::class`). (Ekin)
. Fixed bug #77546 (iptcembed broken function). (gdegoulet)
- Exif:
. Fixed bug #77564 (Memory leak in exif_process_IFD_TAG). (Ben Ramsey)
- Mbstring:
. Fixed bug #77514 (mb_ereg_replace() with trailing backslash adds null byte).
(Nikita)

View file

@ -3378,6 +3378,10 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
break;
case TAG_USERCOMMENT:
EFREE_IF(ImageInfo->UserComment);
ImageInfo->UserComment = NULL;
EFREE_IF(ImageInfo->UserCommentEncoding);
ImageInfo->UserCommentEncoding = NULL;
ImageInfo->UserCommentLength = exif_process_user_comment(ImageInfo, &(ImageInfo->UserComment), &(ImageInfo->UserCommentEncoding), value_ptr, byte_count);
break;

Binary file not shown.

View file

@ -0,0 +1,18 @@
--TEST--
Bug 77564 (Memory leak in exif_process_IFD_TAG)
--SKIPIF--
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
--FILE--
<?php
var_dump(exif_read_data(dirname(__FILE__) . '/bug77564.jpg'));
?>
DONE
--EXPECTF--
Warning: exif_read_data(bug77564.jpg): Illegal IFD offset in %sbug77564.php on line %d
Warning: exif_read_data(bug77564.jpg): File structure corrupted in %sbug77564.php on line %d
Warning: exif_read_data(bug77564.jpg): Invalid JPEG file in %sbug77564.php on line %d
bool(false)
DONE