@@ -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 );
@@ -764,7 +766,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
764
766
continue ;
765
767
}
766
768
if (!node_is_equal (trav ,"port" )) {
767
- soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , trav -> name );
769
+ soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , SAFE_STR ( trav -> name ) );
768
770
}
769
771
770
772
port = trav ;
@@ -803,7 +805,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
803
805
}
804
806
}
805
807
if (trav2 != address && is_wsdl_element (trav2 ) && !node_is_equal (trav2 ,"documentation" )) {
806
- soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , trav2 -> name );
808
+ soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , SAFE_STR ( trav2 -> name ) );
807
809
}
808
810
trav2 = trav2 -> next ;
809
811
}
@@ -905,7 +907,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
905
907
continue ;
906
908
}
907
909
if (!node_is_equal (trav2 ,"operation" )) {
908
- soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , trav2 -> name );
910
+ soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , SAFE_STR ( trav2 -> name ) );
909
911
}
910
912
911
913
operation = trav2 ;
@@ -924,7 +926,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
924
926
!node_is_equal (trav3 ,"output" ) &&
925
927
!node_is_equal (trav3 ,"fault" ) &&
926
928
!node_is_equal (trav3 ,"documentation" )) {
927
- soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , trav3 -> name );
929
+ soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , SAFE_STR ( trav3 -> name ) );
928
930
}
929
931
trav3 = trav3 -> next ;
930
932
}
@@ -1102,7 +1104,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
1102
1104
}
1103
1105
}
1104
1106
} else if (is_wsdl_element (trav ) && !node_is_equal (trav ,"documentation" )) {
1105
- soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , trav -> name );
1107
+ soap_error1 (E_ERROR , "Parsing WSDL: Unexpected WSDL element <%s>" , SAFE_STR ( trav -> name ) );
1106
1108
}
1107
1109
trav = trav -> next ;
1108
1110
}
0 commit comments