php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13477 gethostbyname() result broken if used same variable as argument
Submitted: 2001-09-28 06:45 UTC Modified: 2001-09-28 08:01 UTC
From: khimich at ukr dot net Assigned:
Status: Closed Package: Network related
PHP Version: 4.0CVS-2001-09-28 OS: FreeBSD 4.3
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: khimich at ukr dot net
New email:
PHP Version: OS:

 

 [2001-09-28 06:45 UTC] khimich at ukr dot net
This expression returns corrupted value:

  $host=gethostbyname($host);

This variant is good:

  $temp=gethostbyname($host);
  $host=$temp;

Even this:
  $host=$temp=gethostbyname($host);

Return two corrupted values for $temp and $host

Oleg Khimich.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-28 07:02 UTC] derick@php.net
I could not reproduce this with PHP 4.0.3/OpenBSD, PHP 4.0.6/Linux, PHP 4.0.7RC2/Linux or latest CVS/Linux...

Can you please post the whole script, and possible can you show us the failing script on a webserver?

Derick
 [2001-09-28 07:46 UTC] derick@php.net
Also tried it on php 4.0.8dev on FreeBSD 4.3. Works fine too.

Derick
 [2001-09-28 08:01 UTC] khimich at ukr dot net
Seems that I can't reproduce this on simple scripts too.
I've stable errors on my complex site. This script uses two nested functions with includes. In one include I'm used gethostname() and it broke my variable.

So, I'm closing this bug, because I can't reproduce all of my code.

Oleg Khimich.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 11 03:01:29 2024 UTC