From: Antony Dovgal Date: Wed, 12 Nov 2008 09:05:48 +0000 (+0000) Subject: make sure the slash is actually thre before reading past it X-Git-Tag: php-5.3.0alpha2~178 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=512b8127611656c0ea578cf721c4daf60424d3a5;p=php make sure the slash is actually thre before reading past it --- diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 10f0ad5056..50a8598df1 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -517,10 +517,10 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco Z_STRVAL_P(p) = colon + 1; } } else { - char *save = actual; + char *save = actual, *slash; int actual_len = Z_STRLEN_P(p); - if (Z_TYPE_P(p) & IS_CONSTANT_UNQUALIFIED) { - actual = (char *)zend_memrchr(actual, '\\', actual_len) + 1; + if ((Z_TYPE_P(p) & IS_CONSTANT_UNQUALIFIED) && (slash = (char *)zend_memrchr(actual, '\\', actual_len))) { + actual = slash + 1; actual_len -= (actual - Z_STRVAL_P(p)); if (inline_change) { actual = estrndup(actual, actual_len);