Skip to content
This repository was archived by the owner on Aug 24, 2021. It is now read-only.

Commit d88b006

Browse files
committed
Merge branch 'PHP-7.3'
* PHP-7.3: Fix #75282: xmlrpc_encode_request() crashes
2 parents 63353b9 + 1080010 commit d88b006

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

ext/xmlrpc/config.m4

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ if test "$PHP_XMLRPC" = "yes"; then
8787
-I@ext_srcdir@/libxmlrpc -DVERSION="0.50")
8888
PHP_ADD_BUILD_DIR($ext_builddir/libxmlrpc)
8989
XMLRPC_MODULE_TYPE=builtin
90+
AC_DEFINE(HAVE_XMLRPC_BUNDLED, 1, [ ])
9091

9192
elif test "$PHP_XMLRPC" != "no"; then
9293

ext/xmlrpc/config.w32

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

ext/xmlrpc/xmlrpc-epi-php.c

+12
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,11 @@ PHP_FUNCTION(xmlrpc_encode_request)
695695
outBuf = XMLRPC_REQUEST_ToXML(xRequest, 0);
696696
if (outBuf) {
697697
RETVAL_STRING(outBuf);
698+
#ifdef HAVE_XMLRPC_BUNDLED
698699
efree(outBuf);
700+
#else
701+
free(outBuf);
702+
#endif
699703
}
700704
XMLRPC_RequestFree(xRequest, 1);
701705
}
@@ -729,7 +733,11 @@ PHP_FUNCTION(xmlrpc_encode)
729733
if (xOut) {
730734
if (outBuf) {
731735
RETVAL_STRING(outBuf);
736+
#ifdef HAVE_XMLRPC_BUNDLED
732737
efree(outBuf);
738+
#else
739+
free(outBuf);
740+
#endif
733741
}
734742
/* cleanup */
735743
XMLRPC_CleanupValue(xOut);
@@ -1092,7 +1100,11 @@ PHP_FUNCTION(xmlrpc_server_call_method)
10921100
outBuf = XMLRPC_REQUEST_ToXML(xResponse, &buf_len);
10931101
if (outBuf) {
10941102
RETVAL_STRINGL(outBuf, buf_len);
1103+
#ifdef HAVE_XMLRPC_BUNDLED
10951104
efree(outBuf);
1105+
#else
1106+
free(outBuf);
1107+
#endif
10961108
}
10971109
/* cleanup after ourselves. what a sty! */
10981110
XMLRPC_RequestFree(xResponse, 0);

0 commit comments

Comments
 (0)