1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 18:53:33 +02:00

Fix CID 538/539, explicitely check for something that should never occur

This commit is contained in:
Etienne Kneuss
2011-08-12 22:05:10 +00:00
parent cf2db20123
commit bb7a93081e
+10 -4
View File
@@ -322,8 +322,11 @@ static zval **spl_array_get_dimension_ptr_ptr(int check_inherited, zval *object,
zval *value;
ALLOC_INIT_ZVAL(value);
zend_symtable_update(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void**)&value, sizeof(void*), NULL);
zend_symtable_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) &retval);
return retval;
if (zend_symtable_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) &retval) != FAILURE) {
return retval;
} else {
return &EG(uninitialized_zval_ptr);
}
} else {
zend_error(E_NOTICE, "Undefined index: %s", Z_STRVAL_P(offset));
return &EG(uninitialized_zval_ptr);
@@ -345,8 +348,11 @@ static zval **spl_array_get_dimension_ptr_ptr(int check_inherited, zval *object,
zval *value;
ALLOC_INIT_ZVAL(value);
zend_hash_index_update(ht, index, (void**)&value, sizeof(void*), NULL);
zend_hash_index_find(ht, index, (void **) &retval);
return retval;
if (zend_hash_index_find(ht, index, (void **) &retval) != FAILURE) {
return retval;
} else {
return &EG(uninitialized_zval_ptr);
}
} else {
zend_error(E_NOTICE, "Undefined offset: %ld", index);
return &EG(uninitialized_zval_ptr);