Bug #58023 [Opn->Fbk]: Fileinfo causes Apache to crash when trying to get MIME for a 0 byte file

From: Date: Wed, 15 Apr 2015 15:10:41 +0000
Subject: Bug #58023 [Opn->Fbk]: Fileinfo causes Apache to crash when trying to get MIME for a 0 byte file
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192108@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=58023&edit=1 ID: 58023 Updated by: cmb@php.net Reported by: lunet6 at gmail dot com Summary: Fileinfo causes Apache to crash when trying to get MIME for a 0 byte file -Status: Open +Status: Feedback Type: Bug -Package: Fileinfo +Package: *General Issues Operating System: Windows XP SP2/ Vista PHP Version: 5.2.1 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: 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? Previous Comments: ------------------------------------------------------------------------ [2008-01-31 05:29:19] 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=58023&edit=1

« previous php.bugs (#192108) next »