Skip to content

Commit f33091c

Browse files
committed
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4: soap: Fix const violation
2 parents bc0871d + c4c1261 commit f33091c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ext/soap/php_encoding.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,23 +2524,25 @@ static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data)
25242524
if (data &&
25252525
(attr = get_soap_enc_attribute(data->properties,"arrayType")) &&
25262526
attr->children && attr->children->content) {
2527-
char *type, *end, *ns;
2527+
const char *type;
2528+
char *end, *ns;
25282529
xmlNsPtr nsptr;
25292530

25302531
parse_namespace(attr->children->content, &type, &ns);
2532+
char *type_dup = estrdup(type);
25312533
nsptr = xmlSearchNs(attr->doc, attr->parent, BAD_CAST(ns));
25322534

2533-
end = strrchr(type,'[');
2535+
end = strrchr(type_dup,'[');
25342536
if (end) {
25352537
*end = '\0';
25362538
dimension = calc_dimension(end+1);
25372539
dims = get_position(dimension, end+1);
25382540
}
25392541
if (nsptr != NULL) {
2540-
enc = get_encoder(SOAP_GLOBAL(sdl), (char*)nsptr->href, type);
2542+
enc = get_encoder(SOAP_GLOBAL(sdl), (char*)nsptr->href, type_dup);
25412543
}
25422544
if (ns) {efree(ns);}
2543-
2545+
if (type_dup) efree(type_dup);
25442546
} else if ((attr = get_soap_enc_attribute(data->properties,"itemType")) &&
25452547
attr->children &&
25462548
attr->children->content) {

0 commit comments

Comments
 (0)