Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.7

Bug #17743 $this used in statically called Net_DNS_Packet::dn_expand()
Submitted: 2010-08-19 03:54 UTC
From: mrubinsk Assigned: bate
Status: Closed Package: Net_DNS (version 1.0.5)
PHP Version: 5.3.2 OS: linux
Roadmaps: (Not assigned)    
Subscription  


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 50 - 8 = ?

 
 [2010-08-19 03:54 UTC] mrubinsk (Michael Rubinsky)
Description: ------------ $this is used to access the Net_DNS_Packet->INT16SZ property in the Net_DNS_Packet::dn_expand() method, which is called statically from numerous places in the code. Actual result: -------------- incorrect $offset calculated, and notices thrown, e.g. Notice: Undefined property: Net_DNS_RR_SOA::$INT16SZ in /opt/local/lib/php/Net/DNS/Packet.php on line 421

Comments

 [2010-08-19 04:20 UTC] doconnor (Daniel O'Connor)
Are you able to provide a quick reproduce script? I can see the bug; but am having a bit of trouble writing a good test case for it.
 [2010-08-19 04:26 UTC] doconnor (Daniel O'Connor)
r302462 adds really basic unit tests which cover practically nothing
 [2010-08-19 04:27 UTC] doconnor (Daniel O'Connor)
 [2010-08-19 04:28 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Verified
 [2010-08-20 01:56 UTC] mrubinsk (Michael Rubinsky)
Couldn't attach a *.php file to the bug for the test script, but it's simple enough: require_once "Net/DNSBL.php"; require_once "PHPUnit/Framework/TestCase.php"; /** */ class TestBug17743 extends PHPUnit_Framework_TestCase { public function testNonStaticContext() { $resolver = new Net_DNS_Resolver(); $host = '127.0.0.1'; if ($response = $resolver->query($host, 'PTR')) { foreach ($response->answer as $val) { if (isset($val->ptrdname)) { $ptrdname = $val->ptrdname; break; } } } } }
 [2010-08-20 02:03 UTC] mrubinsk (Michael Rubinsky)
...and of course, the require statement should be: + require_once "Net/DNS.php"; - require_once "Net/DNSBL.php";
 [2010-08-25 12:26 UTC] bate (Marco Kaiser)
-Status: Verified +Status: Closed -Assigned To: +Assigned To: bate
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.
 [2010-10-26 02:44 UTC] doconnor (Daniel O'Connor)
-Status: Closed +Status: Open
 [2010-10-26 02:45 UTC] doconnor (Daniel O'Connor)
Caused Bug #17995
 [2010-10-26 03:07 UTC] doconnor (Daniel O'Connor)
-Status: Assigned +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.