From ff9ad113e9b907e01f2a427f9482962c4ee7e3a0 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Fri, 18 Jul 2008 19:24:49 +0000 Subject: [PATCH] - New tests --- ext/xmlrpc/tests/bug45555.phpt | 20 +++++++++++++++++ ext/xmlrpc/tests/bug45556.phpt | 41 ++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 ext/xmlrpc/tests/bug45555.phpt create mode 100644 ext/xmlrpc/tests/bug45556.phpt diff --git a/ext/xmlrpc/tests/bug45555.phpt b/ext/xmlrpc/tests/bug45555.phpt new file mode 100644 index 0000000000..376b14fec0 --- /dev/null +++ b/ext/xmlrpc/tests/bug45555.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #45555 (Segfault with invalid non-string as register_introspection_callback) +--FILE-- + 'xml', 'version' => 'xmlrpc'); +xmlrpc_server_call_method ($server, $request, NULL, $options); + +?> +--EXPECTF-- +Warning: xmlrpc_server_call_method(): Invalid callback '1' passed in %s on line %d + +Warning: xmlrpc_server_call_method(): Invalid callback 'foo::bar' passed in %s on line %d diff --git a/ext/xmlrpc/tests/bug45556.phpt b/ext/xmlrpc/tests/bug45556.phpt new file mode 100644 index 0000000000..9c73e0e5df --- /dev/null +++ b/ext/xmlrpc/tests/bug45556.phpt @@ -0,0 +1,41 @@ +--TEST-- +Bug #45556 (Return value from callback isn't freed) +--FILE-- + 'xml', 'version' => 'xmlrpc'); +xmlrpc_server_call_method ($server, $request, NULL, $options); + +?> +--EXPECTF-- + +Warning: xmlrpc_server_call_method(): Invalid callback 'foobar' passed in %s on line %d +expat reports error code 5 + description: Invalid document end + line: 1 + column: 1 + byte index: 0 + total bytes: 0 + + data beginning 0 before byte index: foo + +Warning: xmlrpc_server_call_method(): xml parse error: [line 1, column 1, message: Invalid document end] Unable to add introspection data returned from bar::test() in %s on line %d + +Warning: xmlrpc_server_call_method(): Invalid callback 'foo::bar' passed in %s on line %d -- 2.50.1