php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31633 stream_socket_accept segfaults when peername is used
Submitted: 2005-01-21 14:14 UTC Modified: 2005-01-21 15:27 UTC
From: ron at xit dot nl Assigned:
Status: Closed Package: Sockets related
PHP Version: 5.0.3 OS: Linux 2.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
49 - 24 = ?
Subscribe to this entry?

 
 [2005-01-21 14:14 UTC] ron at xit dot nl
Description:
------------
When I use the optional peername parameter in stream_socket_accept() the script segfaults. Everything works fine when I don't use this parameter. The segfault occurs immediately when I call the function, before any connection with a client can be established.

Reproduce code:
---------------
#!/usr/bin/php5
<?
  $server = stream_socket_server("tcp://0.0.0.0:12345");
  $client = stream_socket_accept($server, 3, $peername);
?>

Expected result:
----------------
nothing

Actual result:
--------------
Segmentation fault

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-21 15:27 UTC] dmitry@php.net
Already fixed in CVS (PHP_5_0 and HEAD).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 13:01:30 2024 UTC