note 93049 added to function.gethostbyaddr
| From: | EricTerstegen at osu1 dot php dot net | Date: | Thu, 20 Aug 2009 18:35:46 +0000 |
| Subject: | note 93049 added to function.gethostbyaddr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-159716@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 208.69.120.35
Probable Submitter: 206.210.161.13
----
Manual Page -- http://www.php.net/manual/en/function.gethostbyaddr.php
Edit -- https://master.php.net/note/edit/93049
Del: integrated -- https://master.php.net/note/delete/93049/integrated
Del: useless -- https://master.php.net/note/delete/93049/useless
Del: bad code -- https://master.php.net/note/delete/93049/bad+code
Del: spam -- https://master.php.net/note/delete/93049/spam
Del: non-english -- https://master.php.net/note/delete/93049/non-english
Del: in docs -- https://master.php.net/note/delete/93049/in+docs
Del: other reasons-- https://master.php.net/note/delete/93049
Reject -- https://master.php.net/note/reject/93049
Search -- https://master.php.net/manage/user-notes.php