summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-11-14 01:38:52 +0000
committerFelipe Pena <felipe@php.net>2010-11-14 01:38:52 +0000
commit46983d532e7ebff1d6128189d50eb6670befbb6b (patch)
treec800c9826ed4d2c00ca0e49d8c146983e1f1575d
parente0858b424a6bc876d274052b04e3820a955a9592 (diff)
downloadphp-git-46983d532e7ebff1d6128189d50eb6670befbb6b.tar.gz
- Add missing check
-rw-r--r--Zend/zend_constants.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c
index 0d190b269a..f059cf70e8 100644
--- a/Zend/zend_constants.c
+++ b/Zend/zend_constants.c
@@ -440,7 +440,8 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
|| zend_hash_add(EG(zend_constants), name, c->name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) {
/* The internal __COMPILER_HALT_OFFSET__ is prefixed by NULL byte */
- if (memcmp(name, "\0__COMPILER_HALT_OFFSET__", sizeof("\0__COMPILER_HALT_OFFSET__")) == 0) {
+ if (c->name[0] == '\0' && c->name_len > sizeof("\0__COMPILER_HALT_OFFSET__")
+ && memcmp(name, "\0__COMPILER_HALT_OFFSET__", sizeof("\0__COMPILER_HALT_OFFSET__")) == 0) {
name++;
}
zend_error(E_NOTICE,"Constant %s already defined", name);