cvs: /php4/ext/wddx wddx.c

From: Date: Fri, 03 Sep 1999 14:17:10 +0000
Subject: cvs: /php4/ext/wddx wddx.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-4038@lists.php.net to get a copy of this message
andrey Fri Sep 3 10:17:10 1999 EDT Modified files: /php4/ext/wddx wddx.c Log: Fixed resource handling to conform to PHP4 guidelines. Index: php4/ext/wddx/wddx.c diff -u php4/ext/wddx/wddx.c:1.4 php4/ext/wddx/wddx.c:1.5 --- php4/ext/wddx/wddx.c:1.4 Thu Aug 26 09:25:53 1999 +++ php4/ext/wddx/wddx.c Fri Sep 3 10:17:10 1999 @@ -27,7 +27,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: wddx.c,v 1.4 1999/08/26 13:25:53 andrey Exp $ */ +/* $Id: wddx.c,v 1.5 1999/09/03 14:17:10 andrey Exp $ */ #include "php.h" #include "php_wddx.h" @@ -734,7 +734,7 @@ packet = emalloc(sizeof(wddx_packet)); if (!packet) { - zend_error(E_WARNING, "Unable to allocate memory in php_wddx_packet_start"); + zend_error(E_WARNING, "Unable to allocate memory in wddx_packet_start"); RETURN_FALSE; } @@ -749,8 +749,8 @@ _php_wddx_packet_start(packet, NULL); _php_wddx_add_chunk(packet, WDDX_STRUCT_S); - - RETURN_LONG(zend_list_insert(packet, le_wddx)); + + RETURN_RESOURCE(zend_list_insert(packet, le_wddx)); } /* }}} */ @@ -768,7 +768,11 @@ WRONG_PARAM_COUNT; } - convert_to_long(packet_id); + if (packet_id->type != IS_RESOURCE) + { + zend_error(E_WARNING, "Invalid packet ID in call to wddx_packet_end"); + return; + } id = packet_id->value.lval; packet = zend_list_find(id, &type); if (type!=le_wddx) { @@ -812,7 +816,11 @@ packet_id = args[0]; - convert_to_long(packet_id); + if (packet_id->type != IS_RESOURCE) + { + zend_error(E_WARNING, "Invalid packet ID in call to wddx_add_vars"); + return; + } id = packet_id->value.lval; packet = zend_list_find(id, &type); if (type!=le_wddx) {

« previous php.version4 (#4038) next »