diff options
| author | Felipe Pena <felipe@php.net> | 2008-07-18 19:24:49 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2008-07-18 19:24:49 +0000 |
| commit | ff9ad113e9b907e01f2a427f9482962c4ee7e3a0 (patch) | |
| tree | da97c1d41c9967faff7b5ffe0f985a9d2f6c3095 /ext/xmlrpc/tests | |
| parent | 6e0906323eab689acd013257f4e54f022d115418 (diff) | |
| download | php-git-ff9ad113e9b907e01f2a427f9482962c4ee7e3a0.tar.gz | |
- New tests
Diffstat (limited to 'ext/xmlrpc/tests')
| -rw-r--r-- | ext/xmlrpc/tests/bug45555.phpt | 20 | ||||
| -rw-r--r-- | ext/xmlrpc/tests/bug45556.phpt | 41 |
2 files changed, 61 insertions, 0 deletions
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-- +<?php + +$options = array (); +$request = xmlrpc_encode_request ("system.describeMethods", $options); +$server = xmlrpc_server_create (); + +xmlrpc_server_register_introspection_callback($server, 1); +xmlrpc_server_register_introspection_callback($server, array('foo', 'bar')); + +$options = array ('output_type' => '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-- +<?php + +$options = array (); +$request = xmlrpc_encode_request ("system.describeMethods", $options); +$server = xmlrpc_server_create (); + + +function foo() { return 11111; } + +class bar { + static public function test() { + return 'foo'; + } +} + +xmlrpc_server_register_introspection_callback($server, 'foobar'); +xmlrpc_server_register_introspection_callback($server, array('bar', 'test')); +xmlrpc_server_register_introspection_callback($server, array('foo', 'bar')); + +$options = array ('output_type' => '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 |
