php.net |  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
Votes:1
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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lunet6 at gmail dot com
New email:
PHP Version: OS:

 

 [2008-01-31 05:29 UTC] lunet6 at gmail dot com
Description:
------------
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";
		exit();
	}
	//echo var_dump($handle);
	$file1 = "c:\a.txt";
	$mime_type = finfo_file($handle,$file1);
	echo $mime_type;
	finfo_close($handle);

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:	2.2.6.0
  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.2.0.0.768.3
  Locale ID:	1033
  Additional Information 1:	b20d
  Additional Information 2:	39e3e624db72f4805472ecca389bc21b
  Additional Information 3:	b9e4
  Additional Information 4:	dd248f9918d6cf47cd723c28e9132481

Read our privacy statement:
  http://go.microsoft.com/fwlink/?linkid=50163&clcid=0x0409


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-15 15:10 UTC] cmb@php.net
-Status: Open +Status: Feedback -Package: Fileinfo +Package: *General Issues -Assigned To: +Assigned To: cmb
 [2015-04-15 15:10 UTC] cmb@php.net
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: Sat Apr 20 13:01:29 2024 UTC