php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #65334
Patch bug65334.patch revision 2013-07-26 03:22 UTC by laruence@php.net
revision 2013-07-25 13:38 UTC by laruence@php.net

Patch bug65334.patch for memcached Bug #65334

Patch version 2013-07-26 03:22 UTC

Return to Bug #65334 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: laruence@php.net

diff --git a/php_memcached.c b/php_memcached.c
index d1d0724..4c5217b 100644
--- a/php_memcached.c
+++ b/php_memcached.c
@@ -2884,6 +2884,7 @@ static int php_memc_zval_from_payload(zval *value, char *payload, size_t payload
 	if (payload == NULL && payload_len > 0) {
 		php_error_docref(NULL TSRMLS_CC, E_WARNING,
 			"Could not handle non-existing value of length %zu", payload_len);
+		ZVAL_FALSE(value);
 		return -1;
 	} else if (payload == NULL) {
 		if (MEMC_VAL_GET_TYPE(flags) == MEMC_VAL_IS_BOOL) {
@@ -2935,6 +2936,7 @@ static int php_memc_zval_from_payload(zval *value, char *payload, size_t payload
 		if (!decompress_status) {
 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not decompress value");
 			efree(buffer);
+			ZVAL_FALSE(value);
 			return -1;
 		}
 		payload = buffer;
@@ -3002,6 +3004,7 @@ static int php_memc_zval_from_payload(zval *value, char *payload, size_t payload
 			}
 #else
 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not unserialize value, no igbinary support");
+			ZVAL_FALSE(value);
 			goto my_error;
 #endif
 			break;
@@ -3015,12 +3018,14 @@ static int php_memc_zval_from_payload(zval *value, char *payload, size_t payload
 # endif
 #else
 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not unserialize value, no json support");
+			ZVAL_FALSE(value);
 			goto my_error;
 #endif
 			break;
 
 		default:
 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "unknown payload type");
+			ZVAL_FALSE(value);
 			goto my_error;
 	}
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 00:01:30 2024 UTC