From: Antony Dovgal Date: Wed, 27 Jun 2007 08:51:40 +0000 (+0000) Subject: fix #41813 (segmentation fault when using string offset as an object) X-Git-Tag: php-5.2.4RC1~283 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e26df952372ff564b82bf72e0b579458195a01e;p=php fix #41813 (segmentation fault when using string offset as an object) patch by judas dot iscariote at gmail dot com --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 7c75aad719..6214837cd2 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -530,6 +530,10 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode zval *value = get_zval_ptr(value_op, Ts, &free_value, BP_VAR_R); zval **retval = &T(result->u.var).var.ptr; + if (!object_ptr) { + zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); + } + if (*object_ptr == EG(error_zval_ptr)) { FREE_OP(free_op2); if (!RETURN_VALUE_UNUSED(result)) {