note 93049 deleted from function.gethostbyaddr by danbrown
| From: | danbrown@php.net | Date: | Fri, 21 Aug 2009 13:34:27 +0000 |
| Subject: | note 93049 deleted from function.gethostbyaddr by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-159741@lists.php.net to get a copy of this message | ||
Note Submitter: Eric Terstegen
----
In the sample code gethostbyaddr_timeout there is a bug with the random transaction generation
piece. It can generate a single byte which malforms the packet as it is not correctly padded.
Verifying the 2 bytes seems to work well. This is around the lines:
$data = rand(0, 99);
// trim it to 2 bytes
$data = substr($data, 0, 2);
You can change to: $data = rand(10, 99); for a quick and dirty fix.