Skip to content

Commit 4f28bbd

Browse files
committed
Fix SOAP bailout handling
This code was reusing the _bailout variable from SOAP_CLIENT_BEGIN/END_CODE(). As _bailout is not volatile, modifying it after the setjmp call and then reading it back on return is illegal. Use a separate local bailout variable instead. This fixes the miscompile introduced by marking zend_bailout() as noreturn.
1 parent 3744533 commit 4f28bbd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/soap/soap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,6 +2597,7 @@ static void do_soap_call(zend_execute_data *execute_data,
25972597
int old_features;
25982598
HashTable *old_typemap, *typemap = NULL;
25992599
smart_str action = {0};
2600+
int bailout = 0;
26002601

26012602
SOAP_CLIENT_BEGIN_CODE();
26022603

@@ -2763,7 +2764,7 @@ static void do_soap_call(zend_execute_data *execute_data,
27632764
}
27642765

27652766
} zend_catch {
2766-
_bailout = 1;
2767+
bailout = 1;
27672768
} zend_end_try();
27682769

27692770
if (SOAP_GLOBAL(encoding) != NULL) {
@@ -2775,12 +2776,11 @@ static void do_soap_call(zend_execute_data *execute_data,
27752776
SOAP_GLOBAL(class_map) = old_class_map;
27762777
SOAP_GLOBAL(encoding) = old_encoding;
27772778
SOAP_GLOBAL(sdl) = old_sdl;
2778-
if (_bailout) {
2779+
if (bailout) {
27792780
smart_str_free(&action);
27802781
if (request) {
27812782
xmlFreeDoc(request);
27822783
}
2783-
_bailout = 0;
27842784
zend_bailout();
27852785
}
27862786
SOAP_CLIENT_END_CODE();

0 commit comments

Comments
 (0)