From: Rasmus Lerdorf Date: Tue, 14 Jul 2015 02:38:55 +0000 (-0700) Subject: Fix potential segfault X-Git-Tag: php-7.1.1RC1~35^2~6^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ce4e8c45ede395db9b3c2d157dbeb29a28830c5;p=php Fix potential segfault --- diff --git a/Zend/zend_list.c b/Zend/zend_list.c index 261489b4a1..c2cd606074 100644 --- a/Zend/zend_list.c +++ b/Zend/zend_list.c @@ -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) { - if (resource_type1 == res->type) { + if (res && resource_type1 == res->type) { return res->ptr; } - if (resource_type2 == res->type) { + if (res && resource_type2 == res->type) { return res->ptr; }