Skip to content

Commit fd10ad5

Browse files
committed
Fixed possible SIGSEGV (Rob Richards)
1 parent 1c08413 commit fd10ad5

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

ext/soap/php_encoding.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr par
265265
if (zend_hash_find(ht, "enc_ns", sizeof("enc_ns"), (void **)&zns) == SUCCESS) {
266266
enc = get_encoder(SOAP_GLOBAL(sdl), Z_STRVAL_PP(zns), Z_STRVAL_PP(zstype));
267267
} else {
268-
enc = get_encoder(SOAP_GLOBAL(sdl), NULL, Z_STRVAL_PP(zstype));
268+
enc = get_encoder_ex(SOAP_GLOBAL(sdl), Z_STRVAL_PP(zstype), Z_STRLEN_PP(zstype));
269269
}
270270
}
271271
}

ext/soap/php_schema.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,11 @@ int load_schema(sdlCtx *ctx,xmlNodePtr schema)
232232
location = get_attribute(trav->properties, "schemaLocation");
233233

234234
if (ns != NULL && tns != NULL && strcmp(ns->children->content,tns->children->content) == 0) {
235-
soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s', namespace must not match the enclosing schema 'targetNamespace'", location->children->content);
235+
if (location) {
236+
soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s', namespace must not match the enclosing schema 'targetNamespace'", location->children->content);
237+
} else {
238+
soap_error0(E_ERROR, "Parsing Schema: can't import schema. Namespace must not match the enclosing schema 'targetNamespace'");
239+
}
236240
}
237241
if (location) {
238242
xmlChar *base = xmlNodeGetBase(trav->doc, trav);

ext/soap/php_sdl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,10 @@ static sdlSoapBindingFunctionHeaderPtr wsdl_soap_binding_header(sdlCtx* ctx, xml
410410
if (!h->ns && h->element->namens) {
411411
h->ns = estrdup(h->element->namens);
412412
}
413-
}
414-
if (h->element->name) {
415-
efree(h->name);
416-
h->name = estrdup(h->element->name);
413+
if (h->element->name) {
414+
efree(h->name);
415+
h->name = estrdup(h->element->name);
416+
}
417417
}
418418
}
419419
}

ext/soap/soap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,8 +1797,8 @@ PHP_METHOD(SoapServer, handle)
17971797
/* }}} */
17981798

17991799

1800-
/* {{{ proto SoapServer::fault
1801-
SoapServer::fault */
1800+
/* {{{ proto SoapServer::fault ( staring code, string string [, string actor [, mixed details [, string name]]] )
1801+
Issue SoapFault indicating an error */
18021802
PHP_METHOD(SoapServer, fault)
18031803
{
18041804
char *code, *string, *actor=NULL, *name=NULL;

0 commit comments

Comments
 (0)