From:             getsuryya at rediffmail dot com
Operating system: LINUX
PHP version:      4.3.2
PHP Bug Type:     *Network Functions
Bug description:  function gethostbynamel. This is returning ip addresses for invalid 
domains

Description:
------------
The bug is in the function gethostbynamel. When a domain name is passed to
it as an argument then it should return the associated ip addresses of
this domain in an array, this is working properly in version 4.3.1.

But in version 4.3.2 the bugs are as under.
1)It is returning an ip for a domain name which is not valid, where as it
should have returned false in case of non valid domain name.
2)It is only returning a single ip associated with the domain, not all the
ip addresses.



Reproduce code:
---------------
#CODE FOR CASE 1
if($hosts = gethostbynamel('com')){     
        print_r($hosts);
}else{
        print "Invalid domain";
}

#CODE FOR CASE 2
if($hosts = gethostbynamel('yahoo.com')){
        print_r($hosts);
}else{
        print "Invalid domain";



Expected result:
----------------
#EXPECTED RESULT FOR CASE 1
Invalid domain

#EXPECTED  RESULT FOR CASE 2
Array ( [0] => 216.109.118.76 [1] => 216.109.118.77 [2] => 216.109.118.78
[3] => 216.109.118.65 [4] => 216.109.118.69 [5] => 216.109.118.71 [6] =>
216.109.118.72 [7] => 216.109.118.74 ) 


Actual result:
--------------
#ACTUAL RESULT FOR CASE 1
Array ( [0] => 206.16.0.134 ) 

#ACTUAL RESULT FOR CASE 2
Array ( [0] => 66.218.71.198 )

-- 
Edit bug report at http://bugs.php.net/?id=25342&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25342&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25342&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25342&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25342&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25342&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25342&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25342&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25342&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25342&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25342&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25342&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25342&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25342&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25342&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25342&r=gnused

Reply via email to