PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Networking » Net_DNS » Bug #7069

small bug in Net_DNS_RR::new_from_array()

Details

Submitted2006-03-09 08:13 UTC
Fromsven dot hergenhahn at eur dot sas dot com
Assignedbate
StatusClosed
PackageNet_DNS
PHP Version5.0.5
OSLinux (FC2)
Roadmaps(Not assigned)

Comments

[2006-03-09 08:13 UTC] sven dot hergenhahn at eur dot sas dot com

Description:
------------
function &new_from_array($rrarray) uses $rdata and $rrtype instead of $rr->rdata and $rr->rrtype. As $rdata and $rrtype are not set within the function, you won't get the desired result.

Calling e.g. Net_DNS_RR::display() returns "...; no data" as $rr->rdlength is the length of the unset string $rdata

It's a minor bug, but should be fixed.

Cheers,
Sven

Test script:
---------------
222,223c222,223
< if (strlen($rr->rdata)) {
< $rr->rdlength = strlen($rr->rdata);
---
> if (strlen($rdata)) {
> $rr->rdlength = strlen($rdata);
225c225
< if (class_exists('Net_DNS_RR_' . $rr->rrtype)) {
---
> if (class_exists('Net_DNS_RR_' . $rrtype)) {
227c227
< return new $scn($rr, $rr->rdata);
---
> return new $scn($rr, $rdata);

[2006-03-09 08:18 UTC] sven dot hergenhahn at eur dot sas dot com

sorry, something went wrong. the summary should be:
"small bug in Net_DNS_RR::new_from_array()"

Sorry,
Sven

[2006-03-09 10:15 UTC] sven dot hergenhahn at eur dot sas dot com

yes, now it's fine, thanks.

Sven