php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9082 getpeername() causes seg fault
Submitted: 2001-02-02 14:07 UTC Modified: 2001-04-16 05:24 UTC
From: colin@php.net Assigned:
Status: Closed Package: Sockets related
PHP Version: 4.0 Latest CVS (02/02/2001) OS: rh7.0
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:
29 - 4 = ?
Subscribe to this entry?

 
 [2001-02-02 14:07 UTC] colin@php.net
The proto says:

    getpeername(int fd, string &addr[, int &port])

But if I only pass it the $addr, my script segfaults.
i.e., this works:

    <?  getpeername($socket, &$ip, &$port); ?>

and this doesn't:

    <?  getpeername($socket, &$ip ); ?>

- Colin

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-02 14:45 UTC] mathieu@php.net
Colin

For now I'm not in the CVS thingy to write to the PHP tree, but:

What fixed it for me is putting:
	if (ZEND_NUM_ARGS() == 2)
		MAKE_STD_ZVAL(*port);

after the ifstatement containing the zend_get_parameters().

-- CaPS

 [2001-02-02 14:46 UTC] mathieu@php.net
[Status change]

and:

heh dunno wether it still does what it oughta now though :PPPP
can't test in your environment

 [2001-02-02 15:26 UTC] mathieu@php.net
[Status change]

and:

heh dunno wether it still does what it oughta now though :PPPP
can't test in your environment

 [2001-02-02 15:57 UTC] cmv@php.net
Fixed in CVS ... thanks mathieu.
 [2001-02-03 02:17 UTC] mathieu@php.net
[Status change]

and:

heh dunno wether it still does what it oughta now though :PPPP
can't test in your environment

 [2001-03-16 16:47 UTC] sniper@php.net
Is this fixed or not?

--Jani

 [2001-04-16 05:24 UTC] jmoore@php.net
Colin,

Can you please verify this behaviour and reopen report if its wrong. (the though of a daily email on cron suddenly seems like a good idea :))

-James
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 03:01:28 2024 UTC