php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25428 xmlrpc_server_call_method() causes segfault
Submitted: 2003-09-08 03:38 UTC Modified: 2005-01-26 04:44 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mfladischer at gmx dot net Assigned:
Status: Closed Package: XMLRPC-EPI related
PHP Version: 5.0.0 OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mfladischer at gmx dot net
New email:
PHP Version: OS:

 

 [2003-09-08 03:38 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-14 20:09 UTC] web-php-bugs at sklar dot com
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);
>     }
 [2003-10-14 20:16 UTC] gschlossnagle@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

Patch applied.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 13:01:29 2024 UTC