Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix #75282: xmlrpc_encode_request() crashes
This commit is contained in:
Christoph M. Becker
2018-10-21 12:10:54 +02:00
3 changed files with 14 additions and 1 deletions

View File

@@ -87,6 +87,7 @@ if test "$PHP_XMLRPC" = "yes"; then
-I@ext_srcdir@/libxmlrpc -DVERSION="0.50")
PHP_ADD_BUILD_DIR($ext_builddir/libxmlrpc)
XMLRPC_MODULE_TYPE=builtin
AC_DEFINE(HAVE_XMLRPC_BUNDLED, 1, [ ])
elif test "$PHP_XMLRPC" != "no"; then

View File

@@ -12,7 +12,7 @@ if (PHP_XMLRPC != "no") {
ADD_SOURCES(configure_module_dirname + "/libxmlrpc", "base64.c simplestring.c xml_to_dandarpc.c \
xmlrpc_introspection.c encodings.c system_methods.c xml_to_xmlrpc.c \
queue.c xml_element.c xmlrpc.c xml_to_soap.c", "xmlrpc");
AC_DEFINE("HAVE_XMLRPC_BUNDLED", 1);
} else {
WARNING("xmlrpc support can't be enabled, libraries or headers are missing")
PHP_XMLRPC = "no";

View File

@@ -695,7 +695,11 @@ PHP_FUNCTION(xmlrpc_encode_request)
outBuf = XMLRPC_REQUEST_ToXML(xRequest, 0);
if (outBuf) {
RETVAL_STRING(outBuf);
#ifdef HAVE_XMLRPC_BUNDLED
efree(outBuf);
#else
free(outBuf);
#endif
}
XMLRPC_RequestFree(xRequest, 1);
}
@@ -729,7 +733,11 @@ PHP_FUNCTION(xmlrpc_encode)
if (xOut) {
if (outBuf) {
RETVAL_STRING(outBuf);
#ifdef HAVE_XMLRPC_BUNDLED
efree(outBuf);
#else
free(outBuf);
#endif
}
/* cleanup */
XMLRPC_CleanupValue(xOut);
@@ -1092,7 +1100,11 @@ PHP_FUNCTION(xmlrpc_server_call_method)
outBuf = XMLRPC_REQUEST_ToXML(xResponse, &buf_len);
if (outBuf) {
RETVAL_STRINGL(outBuf, buf_len);
#ifdef HAVE_XMLRPC_BUNDLED
efree(outBuf);
#else
free(outBuf);
#endif
}
/* cleanup after ourselves. what a sty! */
XMLRPC_RequestFree(xResponse, 0);