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