From 512b8127611656c0ea578cf721c4daf60424d3a5 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Wed, 12 Nov 2008 09:05:48 +0000 Subject: [PATCH] make sure the slash is actually thre before reading past it --- Zend/zend_execute_API.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); -- 2.50.1