php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #60701
Patch bug60701.patch revision 2012-01-20 13:30 UTC by hans at rakers dot org

Patch bug60701.patch for Reproducible crash Bug #60701

Patch version 2012-01-20 13:30 UTC

Return to Bug #60701 | Download this patch
Patch Revisions:

Developer: hans@rakers.org

--- zend_object_handlers.c~	2012-01-17 13:24:34.000000000 +0100
+++ zend_object_handlers.c	2012-01-17 13:25:26.000000000 +0100
@@ -1276,9 +1276,13 @@
 					return FAILURE;
 				}
 				if (Z_TYPE_P(retval) == IS_STRING) {
-					INIT_PZVAL(writeobj);
 					if (readobj == writeobj) {
+						if (Z_REFCOUNT_P(readobj) <= 1) {
+							INIT_PZVAL(writeobj);
+						}
 						zval_dtor(readobj);
+					} else {
+						INIT_PZVAL(writeobj);
 					}
 					ZVAL_ZVAL(writeobj, retval, 1, 1);
 					if (Z_TYPE_P(writeobj) != type) {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 22:01:26 2024 UTC