Home » Networking » Net_DNS » Bug #4998
Wrong test in SRV::rr_rdata()
Details
| Submitted | 2005-08-04 16:45 UTC |
|---|---|
| From | romain at ludicre dot net |
| Assigned | bate |
| Status | Closed |
| Package | Net_DNS |
| PHP Version | 4.3.10 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2005-08-04 16:45 UTC] romain at ludicre dot net
Description:
------------
Using Net_DNS 1.0.0rc1
In Net/DNS/SRV.php, method rr_rdata() tests whether the priority value is true to decide whether it returns the record data or NULL.
This prevents from getting/upgrading records having the priority set to 0.
It should test whether the prioriry is set or not instead.
Test script:
---------------
Net/DNS/SRV.php, method rr_rdata():
function rr_rdata($packet, $offset)
{
if ($this->preference) {
$rdata = pack('nnn', $this->preference, $this->weight, $this->port);
$rdata .= $packet->dn_comp($this->target, $offset + strlen($rdata));
return($rdata);
}
return(NULL);
}
You should replace :
if ($this->preference) {
by
if (isset($this->preference)) {