Skip to content

Commit f269cdc

Browse files
committed
Improve fix for #74145
1 parent e46d589 commit f269cdc

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

ext/wddx/wddx.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -799,18 +799,23 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
799799
} else if (!strcmp(name, EL_BOOLEAN)) {
800800
int i;
801801

802-
ALLOC_ZVAL(ent.data);
803-
INIT_PZVAL(ent.data);
804-
Z_TYPE_P(ent.data) = IS_BOOL;
805-
ent.type = ST_BOOLEAN;
806-
SET_STACK_VARNAME;
807802
if (atts) for (i = 0; atts[i]; i++) {
808803
if (!strcmp(atts[i], EL_VALUE) && atts[i+1] && atts[i+1][0]) {
804+
ALLOC_ZVAL(ent.data);
805+
INIT_PZVAL(ent.data);
806+
Z_TYPE_P(ent.data) = IS_BOOL;
807+
ent.type = ST_BOOLEAN;
808+
SET_STACK_VARNAME;
809809
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
810810
php_wddx_process_data(user_data, atts[i+1], strlen(atts[i+1]));
811811
break;
812812
}
813813
} else {
814+
ALLOC_ZVAL(ent.data);
815+
INIT_PZVAL(ent.data);
816+
Z_TYPE_P(ent.data) = IS_BOOL;
817+
ent.type = ST_BOOLEAN;
818+
SET_STACK_VARNAME;
814819
ZVAL_FALSE(ent.data);
815820
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
816821
}

0 commit comments

Comments
 (0)