1
0
mirror of https://github.com/php/php-src.git synced 2026-04-05 15:12:39 +02:00

Safer behavior

This commit is contained in:
Zeev Suraski
1999-09-18 13:07:45 +00:00
parent 39dbe1d41b
commit 6ddd686141

View File

@@ -153,7 +153,10 @@ ZEND_API void *zend_fetch_resource_ex(zval *passed_id, int default_id, char *res
int i;
if (default_id==-1) { /* use id */
if (passed_id->type != IS_RESOURCE) {
if (!passed_id) {
zend_error(E_WARNING, "No %s resource supplied", resource_type_name);
return NULL;
} else if (passed_id->type != IS_RESOURCE) {
zend_error(E_WARNING, "Supplied argument is not a valid %s resource", resource_type_name);
return NULL;
}