From d98d1900d51114ebee9ba97ed9a39399c8eb18e6 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Thu, 30 May 2024 23:48:48 +0200 Subject: [PATCH] Fix reading zlib ini settings in ext-soap zend_ini_long() actually expects the length without the NUL byte, but we're passing the length *with* the NUL byte. This mess can actually be avoided altogether by using INI_INT, so use that instead. --- ext/soap/soap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/soap/soap.c b/ext/soap/soap.c index de29917cd87af..4bc41f063f46a 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1520,7 +1520,7 @@ PHP_METHOD(SoapServer, handle) sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8")-1, 1); } - if (zend_ini_long("zlib.output_compression", sizeof("zlib.output_compression"), 0)) { + if (INI_INT("zlib.output_compression")) { sapi_add_header("Connection: close", sizeof("Connection: close")-1, 1); } else { snprintf(cont_len, sizeof(cont_len), "Content-Length: %d", size); @@ -1668,7 +1668,7 @@ static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeade if (use_http_error_status) { sapi_add_header("HTTP/1.1 500 Internal Server Error", sizeof("HTTP/1.1 500 Internal Server Error")-1, 1); } - if (zend_ini_long("zlib.output_compression", sizeof("zlib.output_compression"), 0)) { + if (INI_INT("zlib.output_compression")) { sapi_add_header("Connection: close", sizeof("Connection: close")-1, 1); } else { snprintf(cont_len, sizeof(cont_len), "Content-Length: %d", size);