From f269cdcd4f76accbecd03884f327cffb9a7f1ca9 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Tue, 4 Jul 2017 21:10:08 -0700 Subject: [PATCH] Improve fix for #74145 --- ext/wddx/wddx.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c index 41fdd3d7954..ee72ba21160 100644 --- a/ext/wddx/wddx.c +++ b/ext/wddx/wddx.c @@ -799,18 +799,23 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X } else if (!strcmp(name, EL_BOOLEAN)) { int i; - ALLOC_ZVAL(ent.data); - INIT_PZVAL(ent.data); - Z_TYPE_P(ent.data) = IS_BOOL; - ent.type = ST_BOOLEAN; - SET_STACK_VARNAME; if (atts) for (i = 0; atts[i]; i++) { if (!strcmp(atts[i], EL_VALUE) && atts[i+1] && atts[i+1][0]) { + ALLOC_ZVAL(ent.data); + INIT_PZVAL(ent.data); + Z_TYPE_P(ent.data) = IS_BOOL; + ent.type = ST_BOOLEAN; + SET_STACK_VARNAME; wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); php_wddx_process_data(user_data, atts[i+1], strlen(atts[i+1])); break; } } else { + ALLOC_ZVAL(ent.data); + INIT_PZVAL(ent.data); + Z_TYPE_P(ent.data) = IS_BOOL; + ent.type = ST_BOOLEAN; + SET_STACK_VARNAME; ZVAL_FALSE(ent.data); wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); }