php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #61011
Patch bug61011.phpt revision 2012-02-11 03:14 UTC by laruence@php.net
revision 2012-02-08 16:05 UTC by laruence@php.net
Patch bug61011.patch revision 2012-02-11 03:13 UTC by laruence@php.net
revision 2012-02-08 16:05 UTC by laruence@php.net

Patch bug61011.patch for Reproducible crash Bug #61011

Patch version 2012-02-08 16:05 UTC

Return to Bug #61011 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: laruence@php.net

Index: Zend/zend_vm_def.h
===================================================================
--- Zend/zend_vm_def.h	(revision 323122)
+++ Zend/zend_vm_def.h	(working copy)
@@ -1039,6 +1039,14 @@
 				ce = CACHED_PTR(opline->op2.literal->cache_slot);
 			} else {
 				ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
+				if (!ce) {
+					FREE_OP1();
+					if (OP1_TYPE != IS_CONST && varname == &tmp_varname) {
+						zval_dtor(&tmp_varname);
+					}
+					CHECK_EXCEPTION();
+					ZEND_VM_NEXT_OPCODE();
+				}
 				CACHE_PTR(opline->op2.literal->cache_slot, ce);
 			}
 		} else {
Index: Zend/zend_vm_execute.h
===================================================================
--- Zend/zend_vm_execute.h	(revision 323122)
+++ Zend/zend_vm_execute.h	(working copy)
@@ -3236,6 +3236,14 @@
 				ce = CACHED_PTR(opline->op2.literal->cache_slot);
 			} else {
 				ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
+				if (!ce) {
+
+					if (IS_CONST != IS_CONST && varname == &tmp_varname) {
+						zval_dtor(&tmp_varname);
+					}
+					CHECK_EXCEPTION();
+					ZEND_VM_NEXT_OPCODE();
+				}
 				CACHE_PTR(opline->op2.literal->cache_slot, ce);
 			}
 		} else {
@@ -4711,6 +4719,14 @@
 				ce = CACHED_PTR(opline->op2.literal->cache_slot);
 			} else {
 				ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
+				if (!ce) {
+
+					if (IS_CONST != IS_CONST && varname == &tmp_varname) {
+						zval_dtor(&tmp_varname);
+					}
+					CHECK_EXCEPTION();
+					ZEND_VM_NEXT_OPCODE();
+				}
 				CACHE_PTR(opline->op2.literal->cache_slot, ce);
 			}
 		} else {
@@ -5247,6 +5263,14 @@
 				ce = CACHED_PTR(opline->op2.literal->cache_slot);
 			} else {
 				ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
+				if (!ce) {
+
+					if (IS_CONST != IS_CONST && varname == &tmp_varname) {
+						zval_dtor(&tmp_varname);
+					}
+					CHECK_EXCEPTION();
+					ZEND_VM_NEXT_OPCODE();
+				}
 				CACHE_PTR(opline->op2.literal->cache_slot, ce);
 			}
 		} else {
@@ -7629,6 +7653,14 @@
 				ce = CACHED_PTR(opline->op2.literal->cache_slot);
 			} else {
 				ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
+				if (!ce) {
+					zval_dtor(free_op1.var);
+					if (IS_TMP_VAR != IS_CONST && varname == &tmp_varname) {
+						zval_dtor(&tmp_varname);
+					}
+					CHECK_EXCEPTION();
+					ZEND_VM_NEXT_OPCODE();
+				}
 				CACHE_PTR(opline->op2.literal->cache_slot, ce);
 			}
 		} else {
@@ -8975,6 +9007,14 @@
 				ce = CACHED_PTR(opline->op2.literal->cache_slot);
 			} else {
 				ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
+				if (!ce) {
+					zval_dtor(free_op1.var);
+					if (IS_TMP_VAR != IS_CONST && varname == &tmp_varname) {
+						zval_dtor(&tmp_varname);
+					}
+					CHECK_EXCEPTION();
+					ZEND_VM_NEXT_OPCODE();
+				}
 				CACHE_PTR(opline->op2.literal->cache_slot, ce);
 			}
 		} else {
@@ -9512,6 +9552,14 @@
 				ce = CACHED_PTR(opline->op2.literal->cache_slot);
 			} else {
 				ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
+				if (!ce) {
+					zval_dtor(free_op1.var);
+					if (IS_TMP_VAR != IS_CONST && varname == &tmp_varname) {
+						zval_dtor(&tmp_varname);
+					}
+					CHECK_EXCEPTION();
+					ZEND_VM_NEXT_OPCODE();
+				}
 				CACHE_PTR(opline->op2.literal->cache_slot, ce);
 			}
 		} else {
@@ -12568,6 +12616,14 @@
 				ce = CACHED_PTR(opline->op2.literal->cache_slot);
 			} else {
 				ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
+				if (!ce) {
+					if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+					if (IS_VAR != IS_CONST && varname == &tmp_varname) {
+						zval_dtor(&tmp_varname);
+					}
+					CHECK_EXCEPTION();
+					ZEND_VM_NEXT_OPCODE();
+				}
 				CACHE_PTR(opline->op2.literal->cache_slot, ce);
 			}
 		} else {
@@ -16791,6 +16847,14 @@
 				ce = CACHED_PTR(opline->op2.literal->cache_slot);
 			} else {
 				ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
+				if (!ce) {
+					if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+					if (IS_VAR != IS_CONST && varname == &tmp_varname) {
+						zval_dtor(&tmp_varname);
+					}
+					CHECK_EXCEPTION();
+					ZEND_VM_NEXT_OPCODE();
+				}
 				CACHE_PTR(opline->op2.literal->cache_slot, ce);
 			}
 		} else {
@@ -18582,6 +18646,14 @@
 				ce = CACHED_PTR(opline->op2.literal->cache_slot);
 			} else {
 				ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
+				if (!ce) {
+					if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+					if (IS_VAR != IS_CONST && varname == &tmp_varname) {
+						zval_dtor(&tmp_varname);
+					}
+					CHECK_EXCEPTION();
+					ZEND_VM_NEXT_OPCODE();
+				}
 				CACHE_PTR(opline->op2.literal->cache_slot, ce);
 			}
 		} else {
@@ -28292,6 +28364,14 @@
 				ce = CACHED_PTR(opline->op2.literal->cache_slot);
 			} else {
 				ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
+				if (!ce) {
+
+					if (IS_CV != IS_CONST && varname == &tmp_varname) {
+						zval_dtor(&tmp_varname);
+					}
+					CHECK_EXCEPTION();
+					ZEND_VM_NEXT_OPCODE();
+				}
 				CACHE_PTR(opline->op2.literal->cache_slot, ce);
 			}
 		} else {
@@ -32168,6 +32248,14 @@
 				ce = CACHED_PTR(opline->op2.literal->cache_slot);
 			} else {
 				ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
+				if (!ce) {
+
+					if (IS_CV != IS_CONST && varname == &tmp_varname) {
+						zval_dtor(&tmp_varname);
+					}
+					CHECK_EXCEPTION();
+					ZEND_VM_NEXT_OPCODE();
+				}
 				CACHE_PTR(opline->op2.literal->cache_slot, ce);
 			}
 		} else {
@@ -33830,6 +33918,14 @@
 				ce = CACHED_PTR(opline->op2.literal->cache_slot);
 			} else {
 				ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
+				if (!ce) {
+
+					if (IS_CV != IS_CONST && varname == &tmp_varname) {
+						zval_dtor(&tmp_varname);
+					}
+					CHECK_EXCEPTION();
+					ZEND_VM_NEXT_OPCODE();
+				}
 				CACHE_PTR(opline->op2.literal->cache_slot, ce);
 			}
 		} else {
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 06:02:27 2014 UTC