mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix potential segfault
This commit is contained in:
parent
bce9368dfb
commit
1ce4e8c45e
1 changed files with 2 additions and 2 deletions
|
@ -102,11 +102,11 @@ ZEND_API zend_resource* zend_register_resource(void *rsrc_pointer, int rsrc_type
|
||||||
|
|
||||||
ZEND_API void *zend_fetch_resource2(zend_resource *res, const char *resource_type_name, int resource_type1, int resource_type2)
|
ZEND_API void *zend_fetch_resource2(zend_resource *res, const char *resource_type_name, int resource_type1, int resource_type2)
|
||||||
{
|
{
|
||||||
if (resource_type1 == res->type) {
|
if (res && resource_type1 == res->type) {
|
||||||
return res->ptr;
|
return res->ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resource_type2 == res->type) {
|
if (res && resource_type2 == res->type) {
|
||||||
return res->ptr;
|
return res->ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue