Python 2.7.6 Windows bug in __getslice__ in wiredata.py

9 views
Skip to first unread message

Matthäus Wander

unread,
Jul 24, 2014, 8:50:23 AM7/24/14
to dnspyth...@googlegroups.com
Hi,

__getslice__ in wiredata.py assumes that the right bound will be set to
sys.maxint if unspecified. This not true with 64 bit Python 2.7.6 on
Windows, where sys.maxint is 2^(31)-1 but the right bound is 2^(63)-1.

The bug can be observed when parsing a DNS message with a ::ffff:1.2.3.4
address in AAAA record. The slicing triggers an IndexError which raises
a FormError only on Windows. Example code and bugfix attached.

Thanks for providing dnspython!

Matt
test-ipv4-mapped.py
test-out-expected.txt
test-out-actual.txt
fix-wiredata.patch
Reply all
Reply to author
Forward
0 new messages