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