From: Ilia Alshanetsky Date: Tue, 26 Oct 2004 22:38:34 +0000 (+0000) Subject: Fixed bug #30228 (crash when comparing SimpleXML attribute to a boolean). X-Git-Tag: RELEASE_0_2~828 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb928e70a7989d71620fc268ab3dc6c9a5db94f4;p=php Fixed bug #30228 (crash when comparing SimpleXML attribute to a boolean). --- diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 4fea659469..893d3b6858 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1323,7 +1323,11 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) if (op1->type == IS_BOOL || op2->type == IS_BOOL || op1->type == IS_NULL || op2->type == IS_NULL) { - zendi_convert_to_boolean(op1, op1_copy, result); + if (free_op1) { + convert_to_boolean(op1); + } else { + zendi_convert_to_boolean(op1, op1_copy, result); + } zendi_convert_to_boolean(op2, op2_copy, result); result->type = IS_LONG; result->value.lval = ZEND_NORMALIZE_BOOL(op1->value.lval-op2->value.lval);