com php-src: Fix potential segfault: Zend/zend_list.c
| From: | Rasmus Lerdorf | Date: | Tue, 14 Jul 2015 02:38:55 +0000 |
| Subject: | com php-src: Fix potential segfault: Zend/zend_list.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-87979@lists.php.net to get a copy of this message | ||
Commit: 1ce4e8c45ede395db9b3c2d157dbeb29a28830c5
Author: Rasmus Lerdorf <rasmus@lerdorf.com> Mon, 13 Jul 2015 19:38:55 -0700
Parents: bce9368dfbd2b11258601604a44e2145c9bb2d86
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1ce4e8c45ede395db9b3c2d157dbeb29a28830c5
Log:
Fix potential segfault
Changed paths:
M Zend/zend_list.c
Diff:
diff --git a/Zend/zend_list..c b/Zend/zend_list.c
index 261489b..c2cd606 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;
}