@@ -402,12 +402,15 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml
402
402
encodePtr enc = NULL ;
403
403
HashTable * ht = Z_OBJPROP_P (data );
404
404
405
- if (zend_hash_find (ht , "enc_type" , sizeof ("enc_type" ), (void * * )& ztype ) == FAILURE ) {
405
+ if (zend_hash_find (ht , "enc_type" , sizeof ("enc_type" ), (void * * )& ztype ) == FAILURE ||
406
+ Z_TYPE_PP (ztype ) != IS_LONG ) {
406
407
soap_error0 (E_ERROR , "Encoding: SoapVar has no 'enc_type' property" );
407
408
}
408
409
409
- if (zend_hash_find (ht , "enc_stype" , sizeof ("enc_stype" ), (void * * )& zstype ) == SUCCESS ) {
410
- if (zend_hash_find (ht , "enc_ns" , sizeof ("enc_ns" ), (void * * )& zns ) == SUCCESS ) {
410
+ if (zend_hash_find (ht , "enc_stype" , sizeof ("enc_stype" ), (void * * )& zstype ) == SUCCESS &&
411
+ Z_TYPE_PP (zstype ) == IS_STRING ) {
412
+ if (zend_hash_find (ht , "enc_ns" , sizeof ("enc_ns" ), (void * * )& zns ) == SUCCESS &&
413
+ Z_TYPE_PP (zns ) == IS_STRING ) {
411
414
enc = get_encoder (SOAP_GLOBAL (sdl ), Z_STRVAL_PP (zns ), Z_STRVAL_PP (zstype ));
412
415
} else {
413
416
zns = NULL ;
@@ -443,19 +446,23 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml
443
446
}
444
447
445
448
if (style == SOAP_ENCODED || (SOAP_GLOBAL (sdl ) && encode != enc )) {
446
- if (zend_hash_find (ht , "enc_stype" , sizeof ("enc_stype" ), (void * * )& zstype ) == SUCCESS ) {
447
- if (zend_hash_find (ht , "enc_ns" , sizeof ("enc_ns" ), (void * * )& zns ) == SUCCESS ) {
449
+ if (zend_hash_find (ht , "enc_stype" , sizeof ("enc_stype" ), (void * * )& zstype ) == SUCCESS &&
450
+ Z_TYPE_PP (zstype ) == IS_STRING ) {
451
+ if (zend_hash_find (ht , "enc_ns" , sizeof ("enc_ns" ), (void * * )& zns ) == SUCCESS &&
452
+ Z_TYPE_PP (zns ) == IS_STRING ) {
448
453
set_ns_and_type_ex (node , Z_STRVAL_PP (zns ), Z_STRVAL_PP (zstype ));
449
454
} else {
450
455
set_ns_and_type_ex (node , NULL , Z_STRVAL_PP (zstype ));
451
456
}
452
457
}
453
458
}
454
459
455
- if (zend_hash_find (ht , "enc_name" , sizeof ("enc_name" ), (void * * )& zname ) == SUCCESS ) {
460
+ if (zend_hash_find (ht , "enc_name" , sizeof ("enc_name" ), (void * * )& zname ) == SUCCESS &&
461
+ Z_TYPE_PP (zname ) == IS_STRING ) {
456
462
xmlNodeSetName (node , BAD_CAST (Z_STRVAL_PP (zname )));
457
463
}
458
- if (zend_hash_find (ht , "enc_namens" , sizeof ("enc_namens" ), (void * * )& znamens ) == SUCCESS ) {
464
+ if (zend_hash_find (ht , "enc_namens" , sizeof ("enc_namens" ), (void * * )& znamens ) == SUCCESS &&
465
+ Z_TYPE_PP (zname ) == IS_STRING ) {
459
466
xmlNsPtr nsp = encode_add_ns (node , Z_STRVAL_PP (znamens ));
460
467
xmlSetNs (node , nsp );
461
468
}
0 commit comments