|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58023 Fileinfo causes Apache to crash when trying to get MIME for a 0 byte file
Submitted: 2008-01-31 05:29 UTC Modified: 2015-04-26 04:22 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: lunet6 at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: *General Issues
PHP Version: 5.2.1 OS: Windows XP SP2/ Vista
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
35 + 20 = ?
Subscribe to this entry?

 [2008-01-31 05:29 UTC] lunet6 at gmail dot com
1. Have the code in the "reproduce code" section
2. In windows, open Notepad, and save the blank txt file as c:\a.txt. The file size should be 0 bytes.
3. execute the code

Reproduce code:
$handle = finfo_open(FILEINFO_MIME,'c:\xampp\php\extras\magic');
	if (!$handle) {
		echo "Opening fileinfo database failed";
	//echo var_dump($handle);
	$file1 = "c:\a.txt";
	$mime_type = finfo_file($handle,$file1);
	echo $mime_type;

Expected result:
Apache should not crash. It should return application/empty or similar result.

Actual result:
 Problem Event Name:	APPCRASH
  Application Name:	apache.exe
  Application Version:
  Application Timestamp:	47319811
  Fault Module Name:	ntdll.dll
  Fault Module Version:	6.0.6000.16386
  Fault Module Timestamp:	4549bdc9
  Exception Code:	c0000005
  Exception Offset:	00062086
  OS Version:	6.0.6000.
  Locale ID:	1033
  Additional Information 1:	b20d
  Additional Information 2:	39e3e624db72f4805472ecca389bc21b
  Additional Information 3:	b9e4
  Additional Information 4:	dd248f9918d6cf47cd723c28e9132481

Read our privacy statement:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-15 15:10 UTC]
-Status: Open +Status: Feedback -Package: Fileinfo +Package: *General Issues -Assigned To: +Assigned To: cmb
 [2015-04-15 15:10 UTC]
Does this issue still persist? I have not been able to reproduce it
on Windows 7 with recent PHP versions. Maybe the magic file
delivered with XAMPP was broken?
 [2015-04-26 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 28 11:01:32 2024 UTC