php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79756 finfo_file crash (FILEINFO_MIME)
Submitted: 2020-06-29 09:17 UTC Modified: 2020-06-29 12:27 UTC
From: joris at tactics dot be Assigned: cmb (profile)
Status: Closed Package: Filesystem function related
PHP Version: 7.3.19 OS: Windows
Private report: No CVE-ID: None
 [2020-06-29 09:17 UTC] joris at tactics dot be
Description:
------------
When trying to detect the mime type of a specific file, the php-cgi.exe process crashes. It only happens with one specific .xls file I have. This .xls file does open in Excel without issues.

Test script:
---------------
// $filename is path to a specific file that causes the crash.
// I can't seem to upload this file here anywhere :(
$finfo = finfo_open(FILEINFO_MIME);
$mime = finfo_file($finfo, $filename); // CRASH
finfo_close($finfo);
echo $mime;

Expected result:
----------------
application/vnd.ms-excel; charset=binary


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-06-29 09:20 UTC] laruence@php.net
-Status: Open +Status: Feedback
 [2020-06-29 09:20 UTC] laruence@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2020-06-29 09:26 UTC] nikic@php.net
In this case, more useful than a backtrace would be the Excel file that triggers it. Is is possible to share it?
 [2020-06-29 09:35 UTC] joris at tactics dot be
-Status: Feedback +Status: Open
 [2020-06-29 09:35 UTC] joris at tactics dot be
file can be downloaded here: https://we.tl/t-AfVEKeeUs1
 [2020-06-29 11:20 UTC] sjon@php.net
It's a windows specific issue: https://3v4l.org/WF4Ob #FYI
 [2020-06-29 11:45 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2020-06-29 12:27 UTC] cmb@php.net
-Status: Assigned +Status: Verified
 [2020-06-29 12:27 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #79756: finfo_file crash (FILEINFO_MIME)
On GitHub:  https://github.com/php/php-src/pull/5778
Patch:      https://github.com/php/php-src/pull/5778.patch
 [2020-06-29 15:48 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=816b4c1235d70b1b83d26c415f044fc04a48875f
Log: Fix #79756: finfo_file crash (FILEINFO_MIME)
 [2020-06-29 15:48 UTC] cmb@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC