[PHP] Fix SWIG_ZTS_ConvertResourcePtr() not to dereference NULL

if the type lookup fails.
This commit is contained in:
Olly Betts 2013-06-04 12:53:27 +12:00
commit abfa75b169
2 changed files with 6 additions and 2 deletions

View file

@ -5,3 +5,7 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 2.0.11 (in progress)
============================
2013-06-04: olly
[PHP] Fix SWIG_ZTS_ConvertResourcePtr() not to dereference NULL
if the type lookup fails.

View file

@ -209,11 +209,11 @@ SWIG_ZTS_ConvertResourcePtr(zval *z, swig_type_info *ty, int flags TSRMLS_DC) {
const char *type_name;
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;
}
p = value->ptr;
if (type==-1) return NULL;
type_name=zend_rsrc_list_get_rsrc_type(z->value.lval TSRMLS_CC);