mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Don't index NULL pointer when fetching non-existent constant
This commit is contained in:
parent
ac9a265f01
commit
521c405108
@ -454,12 +454,15 @@ failure:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(flags & ZEND_FETCH_CLASS_SILENT)) {
|
if (!c) {
|
||||||
if (!c) {
|
if (!(flags & ZEND_FETCH_CLASS_SILENT)) {
|
||||||
zend_throw_error(NULL, "Undefined constant '%s'", name);
|
zend_throw_error(NULL, "Undefined constant '%s'", name);
|
||||||
} else if (ZEND_CONSTANT_FLAGS(c) & CONST_DEPRECATED) {
|
|
||||||
zend_error(E_DEPRECATED, "Constant %s is deprecated", name);
|
|
||||||
}
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(flags & ZEND_FETCH_CLASS_SILENT) && (ZEND_CONSTANT_FLAGS(c) & CONST_DEPRECATED)) {
|
||||||
|
zend_error(E_DEPRECATED, "Constant %s is deprecated", name);
|
||||||
}
|
}
|
||||||
return &c->value;
|
return &c->value;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user