@@ -313,6 +313,8 @@ void sdl_restore_uri_credentials(sdlCtx *ctx)
313
313
ctx -> context = NULL ;
314
314
}
315
315
316
+ #define SAFE_STR (a ) ((a)?a:"")
317
+
316
318
static void load_wsdl_ex (zval * this_ptr , char * struri , sdlCtx * ctx , int include )
317
319
{
318
320
sdlPtr tmpsdl = ctx -> sdl ;
@@ -374,7 +376,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include)
374
376
if (node_is_equal_ex (trav2 , "schema" , XSD_NAMESPACE )) {
375
377
load_schema (ctx , trav2 );
376
378
} else if (is_wsdl_element (trav2 ) && !node_is_equal (trav2 ,"documentation" )) {
377
- soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , trav2 -> name );
379
+ soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , SAFE_STR ( trav2 -> name ) );
378
380
}
379
381
trav2 = trav2 -> next ;
380
382
}
@@ -435,7 +437,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include)
435
437
soap_error0 (E_ERROR , "Parsing WSDL: <service> has no name attribute" );
436
438
}
437
439
} else if (!node_is_equal (trav ,"documentation" )) {
438
- soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , trav -> name );
440
+ soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , SAFE_STR ( trav -> name ) );
439
441
}
440
442
trav = trav -> next ;
441
443
}
@@ -545,7 +547,7 @@ static sdlSoapBindingFunctionHeaderPtr wsdl_soap_binding_header(sdlCtx* ctx, xml
545
547
}
546
548
smart_str_free (& key );
547
549
} else if (is_wsdl_element (trav ) && !node_is_equal (trav ,"documentation" )) {
548
- soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , trav -> name );
550
+ soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , SAFE_STR ( trav -> name ) );
549
551
}
550
552
trav = trav -> next ;
551
553
}
@@ -647,7 +649,7 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap
647
649
}
648
650
smart_str_free (& key );
649
651
} else if (is_wsdl_element (trav ) && !node_is_equal (trav ,"documentation" )) {
650
- soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , trav -> name );
652
+ soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , SAFE_STR ( trav -> name ) );
651
653
}
652
654
trav = trav -> next ;
653
655
}
@@ -679,14 +681,14 @@ static HashTable* wsdl_message(sdlCtx *ctx, xmlChar* message_name)
679
681
sdlParamPtr param ;
680
682
681
683
if (trav -> ns != NULL && strcmp ((char * )trav -> ns -> href , WSDL_NAMESPACE ) != 0 ) {
682
- soap_error1 (E_ERROR , "Parsing WSDL: Unexpected extensibility element <%s>" , trav -> name );
684
+ soap_error1 (E_ERROR , "Parsing WSDL: Unexpected extensibility element <%s>" , SAFE_STR ( trav -> name ) );
683
685
}
684
686
if (node_is_equal (trav ,"documentation" )) {
685
687
trav = trav -> next ;
686
688
continue ;
687
689
}
688
690
if (!node_is_equal (trav ,"part" )) {
689
- soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , trav -> name );
691
+ soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , SAFE_STR ( trav -> name ) );
690
692
}
691
693
part = trav ;
692
694
param = emalloc (sizeof (sdlParam ));
@@ -695,7 +697,7 @@ static HashTable* wsdl_message(sdlCtx *ctx, xmlChar* message_name)
695
697
696
698
name = get_attribute (part -> properties , "name" );
697
699
if (name == NULL ) {
698
- soap_error1 (E_ERROR , "Parsing WSDL: No name associated with <part> '%s'" , message -> name );
700
+ soap_error1 (E_ERROR , "Parsing WSDL: No name associated with <part> '%s'" , SAFE_STR ( message -> name ) );
699
701
}
700
702
701
703
param -> paramName = estrdup ((char * )name -> children -> content );
@@ -766,7 +768,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
766
768
continue ;
767
769
}
768
770
if (!node_is_equal (trav ,"port" )) {
769
- soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , trav -> name );
771
+ soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , SAFE_STR ( trav -> name ) );
770
772
}
771
773
772
774
port = trav ;
@@ -805,7 +807,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
805
807
}
806
808
}
807
809
if (trav2 != address && is_wsdl_element (trav2 ) && !node_is_equal (trav2 ,"documentation" )) {
808
- soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , trav2 -> name );
810
+ soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , SAFE_STR ( trav2 -> name ) );
809
811
}
810
812
trav2 = trav2 -> next ;
811
813
}
@@ -907,7 +909,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
907
909
continue ;
908
910
}
909
911
if (!node_is_equal (trav2 ,"operation" )) {
910
- soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , trav2 -> name );
912
+ soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , SAFE_STR ( trav2 -> name ) );
911
913
}
912
914
913
915
operation = trav2 ;
@@ -926,7 +928,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
926
928
!node_is_equal (trav3 ,"output" ) &&
927
929
!node_is_equal (trav3 ,"fault" ) &&
928
930
!node_is_equal (trav3 ,"documentation" )) {
929
- soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , trav3 -> name );
931
+ soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , SAFE_STR ( trav3 -> name ) );
930
932
}
931
933
trav3 = trav3 -> next ;
932
934
}
@@ -1104,7 +1106,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
1104
1106
}
1105
1107
}
1106
1108
} else if (is_wsdl_element (trav ) && !node_is_equal (trav ,"documentation" )) {
1107
- soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , trav -> name );
1109
+ soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , SAFE_STR ( trav -> name ) );
1108
1110
}
1109
1111
trav = trav -> next ;
1110
1112
}
0 commit comments