Menu

#3 Bug in DNS.Lib.Unpacker.getbyte()

open
nobody
None
5
2004-05-14
2004-05-14
Jon Ribbens
No

In Lib.py, the line in getbyte():

if self.offset > len(self.buf):

should be:

if self.offset >= len(self.buf):

Discussion

  • Scott Kitterman

    Scott Kitterman - 2007-01-25

    Logged In: YES
    user_id=1300068
    Originator: NO

    Jon,

    If you are still interested in pydns...

    I am working on fixing bugs in pydns for Ubuntu. If you could give me a little more detail on what problems this causes and how to recreate the problem/verify the fix, I'd be interested in including this. My hope is to get all the upstream bugs (plus the Debian/Ubuntu ones I've fixed already) into an updated package in the next few weeks.

    Thanks,

    Scott K

     
  • Jon Ribbens

    Jon Ribbens - 2007-01-25

    Logged In: YES
    user_id=76089
    Originator: YES

    Sorry, 2.5 years later I can't remember the specific circumstances. I assume it caused a problem with some query or other I was doing.

    However, if you examine the code it is easy to verify the bug and fix without needing to inspect the rest of the program:

    if self.offset > len(self.buf):
    raise UnpackError, "Ran off end of data"
    c = self.buf[self.offset]

    If n == len(buf), buf[n] is invalid, so the check should be >= not > .

     
  • Scott Kitterman

    Scott Kitterman - 2007-01-25

    Logged In: YES
    user_id=1300068
    Originator: NO

    Thanks. I know it's been a long time. I patched pydns for a small bug that got me and packaged it for Ubuntu, so for the moment I'm inspired to try and tackle the rest.

    Scott K

     
  • Scott Kitterman

    Scott Kitterman - 2007-02-16

    Logged In: YES
    user_id=1300068
    Originator: NO

    A fix for this issue has been included in the latest python-dns update in Ubuntu Linux. See https://launchpad.net/ubuntu/+source/python-dns/2.3.0-5.1ubuntu2 for details.

     
  • Scott Kitterman

    Scott Kitterman - 2007-11-19

    Logged In: YES
    user_id=1300068
    Originator: NO

    Fixed in 2.3.1

     
  • Scott Kitterman

    Scott Kitterman - 2011-02-18

    This is fixed in the latest pydns and py3dns.