xref: /php-src/ext/exif/tests/bug78910.phpt (revision bd9f4fa6)
1--TEST--
2Bug #78910: Heap-buffer-overflow READ in exif (OSS-Fuzz #19044)
3--EXTENSIONS--
4exif
5--FILE--
6<?php
7
8var_dump(exif_read_data('data:image/jpg;base64,TU0AKgAAAAwgICAgAAIBDwAEAAAAAgAAACKSfCAgAAAAAEZVSklGSUxN'));
9
10?>
11--EXPECTF--
12Notice: exif_read_data(): Read from TIFF: tag(0x927C,   MakerNote): Illegal format code 0x2020, switching to BYTE in %s on line %d
13
14Warning: exif_read_data(): Process tag(x927C=MakerNote): Illegal format code 0x2020, suppose BYTE in %s on line %d
15
16Warning: exif_read_data(): IFD data too short: 0x0000 offset 0x000C in %s on line %d
17
18Warning: exif_read_data(): Error in TIFF: filesize(x002A) less than start of IFD dir(x46494C4F) in %s on line %d
19array(8) {
20  ["FileDateTime"]=>
21  int(0)
22  ["FileSize"]=>
23  int(42)
24  ["FileType"]=>
25  int(8)
26  ["MimeType"]=>
27  string(10) "image/tiff"
28  ["SectionsFound"]=>
29  string(13) "ANY_TAG, IFD0"
30  ["COMPUTED"]=>
31  array(2) {
32    ["IsColor"]=>
33    int(0)
34    ["ByteOrderMotorola"]=>
35    int(1)
36  }
37  ["Make"]=>
38  array(2) {
39    [0]=>
40    int(1179994697)
41    [1]=>
42    int(1179208781)
43  }
44  ["MakerNote"]=>
45  NULL
46}
47