From: Ilia Alshanetsky Date: Thu, 14 Aug 2003 00:37:42 +0000 (+0000) Subject: Fixed a possible crash due to invalid handling of assert ini options. X-Git-Tag: RELEASE_0_7~665 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=64345cdd6ee17cf7faa0c28f38ed43cdcb10e66f;p=php Fixed a possible crash due to invalid handling of assert ini options. --- diff --git a/ext/standard/assert.c b/ext/standard/assert.c index ec0c0d6736..c01d0c6622 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -56,12 +56,9 @@ static PHP_INI_MH(OnChangeCallback) zval_ptr_dtor(&ASSERTG(callback)); } - MAKE_STD_ZVAL(ASSERTG(callback)); - - if (new_value) { + if (new_value && (ASSERTG(callback) || new_value_length)) { + MAKE_STD_ZVAL(ASSERTG(callback)); ZVAL_STRINGL(ASSERTG(callback), new_value, new_value_length, 1); - } else { - ZVAL_EMPTY_STRING(ASSERTG(callback)); } return SUCCESS;