Bug #68250 [Opn->Fbk]: Crash when finfo_buffer() used in object method
| From: | nikic@php.net | Date: | Fri, 17 Oct 2014 14:49:18 +0000 |
| Subject: | Bug #68250 [Opn->Fbk]: Crash when finfo_buffer() used in object method | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-188170@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68250&edit=1
ID: 68250
Updated by: nikic@php.net
Reported by: miloslav dot hula at gmail dot com
Summary: Crash when finfo_buffer() used in object method
-Status: Open
+Status: Feedback
Type: Bug
Package: Scripting Engine problem
Operating System: Linux
PHP Version: master-Git-2014-10-17 (Git)
Block user comment: N
Private report: N
New Comment:
I've applied a fix in this direction just yesterday
(https://github.com/php/php-src/commit/cf5920e8aa8958d47f391c483d7399fc77a58092), could you try a
more recent build and confirm that the issue is resolved?
Previous Comments:
------------------------------------------------------------------------
[2014-10-17 12:08:09] miloslav dot hula at gmail dot com
Description:
------------
Testing on af3354dc43ae3c4bc6c9a9fb74aee2d9c2f406e3 (10.10.2014).
When calling finfo_buffer() from class method context, warning is emmited. It looks like the
function is thinking that is finfo::buffer().
When I uncomment the first call in test below, I get SIGSEGV.
Test script:
---------------
// var_dump(finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), '<!DOCTYPE html>'));
class Test
{
public function detect()
{
return finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), '<!DOCTYPE html>');
}
}
var_dump(finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), '<!DOCTYPE html>'));
var_dump((new Test)->detect());
Expected result:
----------------
string(9) "text/html"
string(9) "text/html"
Actual result:
--------------
string(9) "text/html"
Warning: finfo_buffer() expects parameter 2 to be long, string given in /tmp/php7/finfo.php on line
7
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68250&edit=1