Fix #65108 (is_callable() triggers Fatal Error)
authorDavid Soria Parra <dsp@php.net>
Mon, 24 Jun 2013 13:38:48 +0000 (15:38 +0200)
committerDavid Soria Parra <dsp@php.net>
Mon, 24 Jun 2013 13:55:10 +0000 (15:55 +0200)
We have to check if the fcall info cache contains a pointer if we
use __call, otherwise we endup in a static lookup.

NEWS
Zend/zend_API.c

diff --git a/NEWS b/NEWS
index 2df33bc52146c512235ea3400437518e02e4a790..0a57834b7519eef5948aea8386ee86cde6d80434 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ PHP                                                                        NEWS
 - Core:
   . Fixed bug #65088 (Generated configure script is malformed on OpenBSD).
     (Adam)
+  . Fixed bug #65108 (is_callable() triggers Fatal Error). (David Soria Parra)
 
 OPcache
   . OPcache must be compatible with LiteSpeed SAPI (Dmitry)
index 56c7c245b53e416dd5d5bd36b3ffb71c5a560f2f..439d80913f013a9891a9b67b6f565105f479bca6 100644 (file)
@@ -2842,7 +2842,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
                }
                if ((check_flags & IS_CALLABLE_CHECK_NO_ACCESS) == 0 &&
                    (fcc->calling_scope &&
-                    (fcc->calling_scope->__call ||
+                    ((fcc->calling_scope->__call && fcc->object_ptr) ||
                      fcc->calling_scope->__callstatic))) {
                        if (fcc->function_handler->op_array.fn_flags & ZEND_ACC_PRIVATE) {
                                if (!zend_check_private(fcc->function_handler, fcc->object_ptr ? Z_OBJCE_P(fcc->object_ptr) : EG(scope), lmname, mlen TSRMLS_CC)) {