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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: colin@php.net
New email:
PHP Version: OS:

 

 [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-2020 The PHP Group
All rights reserved.
Last updated: Mon Apr 06 12:01:25 2020 UTC