Skip to content

Commit c553d17

Browse files
committed
Merge branch 'PHP-7.2' into PHP-7.3
2 parents b6e58dc + c429444 commit c553d17

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ PHP NEWS
1414
. Fixed bug #77530 (PHP crashes when parsing `(2)::class`). (Ekin)
1515
. Fixed bug #77546 (iptcembed broken function). (gdegoulet)
1616

17+
- Exif:
18+
. Fixed bug #77564 (Memory leak in exif_process_IFD_TAG). (Ben Ramsey)
19+
1720
- Mbstring:
1821
. Fixed bug #77514 (mb_ereg_replace() with trailing backslash adds null byte).
1922
(Nikita)

ext/exif/exif.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3378,6 +3378,10 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
33783378
break;
33793379

33803380
case TAG_USERCOMMENT:
3381+
EFREE_IF(ImageInfo->UserComment);
3382+
ImageInfo->UserComment = NULL;
3383+
EFREE_IF(ImageInfo->UserCommentEncoding);
3384+
ImageInfo->UserCommentEncoding = NULL;
33813385
ImageInfo->UserCommentLength = exif_process_user_comment(ImageInfo, &(ImageInfo->UserComment), &(ImageInfo->UserCommentEncoding), value_ptr, byte_count);
33823386
break;
33833387

ext/exif/tests/bug77564/bug77564.jpg

73 Bytes
Loading

ext/exif/tests/bug77564/bug77564.phpt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
Bug 77564 (Memory leak in exif_process_IFD_TAG)
3+
--SKIPIF--
4+
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
5+
--FILE--
6+
<?php
7+
var_dump(exif_read_data(dirname(__FILE__) . '/bug77564.jpg'));
8+
?>
9+
DONE
10+
--EXPECTF--
11+
12+
Warning: exif_read_data(bug77564.jpg): Illegal IFD offset in %sbug77564.php on line %d
13+
14+
Warning: exif_read_data(bug77564.jpg): File structure corrupted in %sbug77564.php on line %d
15+
16+
Warning: exif_read_data(bug77564.jpg): Invalid JPEG file in %sbug77564.php on line %d
17+
bool(false)
18+
DONE

0 commit comments

Comments
 (0)