#47035 [NEW]: dns_get_record returns a garbage byte at the end of a TXT record

From: Date: Thu, 08 Jan 2009 09:07:24 +0000
Subject: #47035 [NEW]: dns_get_record returns a garbage byte at the end of a TXT record
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-132655@lists.php.net to get a copy of this message
From:             valli at icsurselva dot ch
Operating system: gentoo
PHP version:      5.2.8
PHP Bug Type:     Network related
Bug description:  dns_get_record returns a garbage byte at the end of a TXT record

Description:
------------
The last byte of a TXT record returned by dns_get_record
is garbage.


Reproduce code:
---------------
$rt = dns_get_record('82.19.186.195.countries.blackholes.us', DNS_TXT);
$txt = $rt[0]['txt'];
print $txt." (".strlen($txt).")\n";
foreach(str_split($txt) as $char) {
    print "$char\t".ord($char)."\n";
}


Expected result:
----------------
ch (2)
c       99
h       104


Actual result:
--------------
ch (3)
c       99
h       104
        128


-- 
Edit bug report at http://bugs.php.net/?id=47035&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        http://bugs.php.net/fix.php?id=47035&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        http://bugs.php.net/fix.php?id=47035&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        http://bugs.php.net/fix.php?id=47035&r=trysnapshot60
Fixed in CVS:                        http://bugs.php.net/fix.php?id=47035&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47035&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=47035&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=47035&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=47035&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=47035&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=47035&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=47035&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=47035&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=47035&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=47035&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47035&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47035&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=47035&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=47035&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=47035&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=47035&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=47035&r=mysqlcfg



Thread (8 messages)

« previous php.bugs (#132655) next »