[PHP] Fix SWIG_ZTS_ConvertResourcePtr() not to dereference NULL
if the type lookup fails.
This commit is contained in:
parent
918c64af84
commit
abfa75b169
2 changed files with 6 additions and 2 deletions
|
|
@ -5,3 +5,7 @@ See the RELEASENOTES file for a summary of changes in each release.
|
||||||
Version 2.0.11 (in progress)
|
Version 2.0.11 (in progress)
|
||||||
============================
|
============================
|
||||||
|
|
||||||
|
2013-06-04: olly
|
||||||
|
[PHP] Fix SWIG_ZTS_ConvertResourcePtr() not to dereference NULL
|
||||||
|
if the type lookup fails.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -209,11 +209,11 @@ SWIG_ZTS_ConvertResourcePtr(zval *z, swig_type_info *ty, int flags TSRMLS_DC) {
|
||||||
const char *type_name;
|
const char *type_name;
|
||||||
|
|
||||||
value = (swig_object_wrapper *) zend_list_find(z->value.lval, &type);
|
value = (swig_object_wrapper *) zend_list_find(z->value.lval, &type);
|
||||||
if ( flags & SWIG_POINTER_DISOWN ) {
|
if (type==-1) return NULL;
|
||||||
|
if (flags & SWIG_POINTER_DISOWN) {
|
||||||
value->newobject = 0;
|
value->newobject = 0;
|
||||||
}
|
}
|
||||||
p = value->ptr;
|
p = value->ptr;
|
||||||
if (type==-1) return NULL;
|
|
||||||
|
|
||||||
type_name=zend_rsrc_list_get_rsrc_type(z->value.lval TSRMLS_CC);
|
type_name=zend_rsrc_list_get_rsrc_type(z->value.lval TSRMLS_CC);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue