ID:               25428
 Comment by:       web-php-bugs at sklar dot com
 Reported By:      mfladischer at gmx dot net
 Status:           Open
 Bug Type:         XMLRPC-EPI related
 Operating System: RedHat 9
 PHP Version:      5CVS-2003-09-08 (dev)
 New Comment:

This diff against v1.35 of ext/xmlrpc/xmlrpc-epi.php.c fixes the
problem.

diff -r1.35 xmlrpc-epi-php.c
1033c1033,1037
<       set_output_options(&out, *output_opts);
---
>       if (argc == 3) {
>         set_output_options(&out, NULL);
>     } else {
>         set_output_options(&out, *output_opts);
>     }


Previous Comments:
------------------------------------------------------------------------

[2003-09-08 03:38:40] mfladischer at gmx dot net

Description:
------------
When i'm trying to run a XML-RPC server  (using the xml-rpc-extension)
with PHP5 i get a segfault.

Reproduce code:
---------------
<?php
$request = xmlrpc_encode_request("system.listMethods", array());
$server = xmlrpc_server_create();
echo xmlrpc_server_call_method($server, $request, false);
?>

Expected result:
----------------
<?xml version="1.0" encoding="iso-8859-1"?>
<methodResponse>
<params>
 <param>
  <value>
   <array>
    <data>
     <value>
      <string>system.listMethods</string>
     </value>
     <value>
      <string>system.methodHelp</string>
     </value>
     <value>
      <string>system.methodSignature</string>
     </value>
     <value>
      <string>system.describeMethods</string>
     </value>
     <value>
      <string>system.multiCall</string>
     </value>
     <value>
      <string>system.getCapabilities</string>
     </value>
    </data>
   </array>
  </value>
 </param>
</params>
</methodResponse>

Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 19945)]
0x0822d92f in zif_xmlrpc_server_call_method (ht=3,
return_value=0x408ef0ac, this_ptr=0x0, return_value_used=1)
    at /linux/devel/php5/ext/xmlrpc/xmlrpc-epi-php.c:1033
1033            set_output_options(&out, *output_opts);
(gdb) bt
#0  0x0822d92f in zif_xmlrpc_server_call_method (ht=3,
return_value=0x408ef0ac, this_ptr=0x0, return_value_used=1)
    at /linux/devel/php5/ext/xmlrpc/xmlrpc-epi-php.c:1033
#1  0x082a2583 in zend_do_fcall_common_helper (execute_data=0xbfffd180,
op_array=0x408ee410) at /linux/devel/php5/Zend/zend_execute.c:2541
#2  0x082a2d25 in zend_do_fcall_handler (execute_data=0xbfffd180,
op_array=0x408ee410) at /linux/devel/php5/Zend/zend_execute.c:2687
#3  0x0829e834 in execute (op_array=0x408ee410) at
/linux/devel/php5/Zend/zend_execute.c:1267
#4  0x0827f0f7 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /linux/devel/php5/Zend/zend.c:1018
#5  0x0823f15c in php_execute_script (primary_file=0xbffff580) at
/linux/devel/php5/main/main.c:1625
#6  0x082acea7 in main (argc=2, argv=0xbffff614) at
/linux/devel/php5/sapi/cli/php_cli.c:910
#7  0x40767bf7 in __libc_start_main () from /lib/i686/libc.so.6



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=25428&edit=1

Reply via email to