php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78083 exif_read_data() corrupt EXIF header: maximum directory nesting level reached
Submitted: 2019-05-29 16:53 UTC Modified: -
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:0 (0.0%)
From: fermin at ares dot uy Assigned:
Status: Open Package: EXIF related
PHP Version: 7.3.5 OS: Windows 10
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-05-29 16:53 UTC] fermin at ares dot uy
Description:
------------
When using the function "exif_read_data()" on certain jpg images it outputs this warning:

"Warning: exif_read_data(php7D62.tmp): corrupt EXIF header: maximum directory nesting level reached in \path\to\index.php on line 4"

And the metadata field 'title' does not show up on the resulting array.

You can download a problematic image for testing here https://ares.uy/P1110193.JPG

Test script:
---------------
<?php
if (!empty($_FILES)) {
  $imagen = $_FILES['imagen']['tmp_name'];
  $metadata = exif_read_data($imagen, 0, true);
  highlight_string("<?php\n\$metadata =\n" . var_export($metadata, true) . ";\n?>");
}
?>

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>EXIF TEST</title>
  </head>
  <body>
    <form action="/" method="post" enctype="multipart/form-data">
      <input type="file" name="imagen" value="">
      <input type="submit" name="" value="Print EXIF">
    </form>
  </body>
</html>


Expected result:
----------------
No warning message and the complete list of metadata fields on the array outputted by the function exif_read_data.

Actual result:
--------------
Warning message and incomplete metadata array.

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Nov 19 20:01:37 2019 UTC