Merge branch 'PHP-8.3' into PHP-8.4

* PHP-8.3:
  Fix Soap leaking http_msg on error
This commit is contained in:
Niels Dossche 2024-10-06 17:59:49 +02:00
commit ce3869b547
No known key found for this signature in database
GPG key ID: B8A8AD166DF0E2E5
2 changed files with 10 additions and 0 deletions

1
NEWS
View file

@ -96,6 +96,7 @@ PHP NEWS
- SOAP: - SOAP:
. Fixed bug GH-16237 (Segmentation fault when cloning SoapServer). (nielsdos) . Fixed bug GH-16237 (Segmentation fault when cloning SoapServer). (nielsdos)
. Fix Soap leaking http_msg on error. (nielsdos)
- Standard: - Standard:
. Fixed bug GH-16053 (Assertion failure in Zend/zend_hash.c). (Arnaud) . Fixed bug GH-16053 (Assertion failure in Zend/zend_hash.c). (Arnaud)

View file

@ -456,6 +456,7 @@ try_again:
} }
add_soap_fault(this_ptr, "HTTP", "Unable to parse URL", NULL, NULL); add_soap_fault(this_ptr, "HTTP", "Unable to parse URL", NULL, NULL);
smart_str_free(&soap_headers_z); smart_str_free(&soap_headers_z);
efree(http_msg);
return FALSE; return FALSE;
} }
@ -469,6 +470,7 @@ try_again:
} }
add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http and https are allowed.", NULL, NULL); add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http and https are allowed.", NULL, NULL);
smart_str_free(&soap_headers_z); smart_str_free(&soap_headers_z);
efree(http_msg);
return FALSE; return FALSE;
} }
@ -482,6 +484,7 @@ try_again:
add_soap_fault(this_ptr, "HTTP", "SSL support is not available in this build", NULL, NULL); add_soap_fault(this_ptr, "HTTP", "SSL support is not available in this build", NULL, NULL);
PG(allow_url_fopen) = old_allow_url_fopen; PG(allow_url_fopen) = old_allow_url_fopen;
smart_str_free(&soap_headers_z); smart_str_free(&soap_headers_z);
efree(http_msg);
return FALSE; return FALSE;
} }
@ -536,6 +539,7 @@ try_again:
add_soap_fault(this_ptr, "HTTP", "Could not connect to host", NULL, NULL); add_soap_fault(this_ptr, "HTTP", "Could not connect to host", NULL, NULL);
PG(allow_url_fopen) = old_allow_url_fopen; PG(allow_url_fopen) = old_allow_url_fopen;
smart_str_free(&soap_headers_z); smart_str_free(&soap_headers_z);
efree(http_msg);
return FALSE; return FALSE;
} }
} }
@ -687,6 +691,7 @@ try_again:
convert_to_null(Z_CLIENT_USE_PROXY_P(this_ptr)); convert_to_null(Z_CLIENT_USE_PROXY_P(this_ptr));
smart_str_free(&soap_headers_z); smart_str_free(&soap_headers_z);
smart_str_free(&soap_headers); smart_str_free(&soap_headers);
efree(http_msg);
return FALSE; return FALSE;
} }
@ -904,12 +909,14 @@ try_again:
convert_to_null(Z_CLIENT_USE_PROXY_P(this_ptr)); convert_to_null(Z_CLIENT_USE_PROXY_P(this_ptr));
add_soap_fault(this_ptr, "HTTP", "Failed Sending HTTP SOAP request", NULL, NULL); add_soap_fault(this_ptr, "HTTP", "Failed Sending HTTP SOAP request", NULL, NULL);
smart_str_free(&soap_headers_z); smart_str_free(&soap_headers_z);
efree(http_msg);
return FALSE; return FALSE;
} }
smart_str_free(&soap_headers); smart_str_free(&soap_headers);
} else { } else {
add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", NULL, NULL); add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", NULL, NULL);
smart_str_free(&soap_headers_z); smart_str_free(&soap_headers_z);
efree(http_msg);
return FALSE; return FALSE;
} }
@ -926,6 +933,7 @@ try_again:
convert_to_null(Z_CLIENT_USE_PROXY_P(this_ptr)); convert_to_null(Z_CLIENT_USE_PROXY_P(this_ptr));
add_soap_fault(this_ptr, "HTTP", "Error Fetching http headers", NULL, NULL); add_soap_fault(this_ptr, "HTTP", "Error Fetching http headers", NULL, NULL);
smart_str_free(&soap_headers_z); smart_str_free(&soap_headers_z);
efree(http_msg);
return FALSE; return FALSE;
} }
@ -1173,6 +1181,7 @@ try_again:
if (--redirect_max < 1) { if (--redirect_max < 1) {
add_soap_fault(this_ptr, "HTTP", "Redirection limit reached, aborting", NULL, NULL); add_soap_fault(this_ptr, "HTTP", "Redirection limit reached, aborting", NULL, NULL);
smart_str_free(&soap_headers_z); smart_str_free(&soap_headers_z);
efree(http_msg);
return FALSE; return FALSE;
} }