dpkt icon indicating copy to clipboard operation
dpkt copied to clipboard

[patch] dns.unpack_name improvements

Open kbandla opened this issue 9 years ago • 1 comments

From [email protected] on January 15, 2014 09:41:10

In my research, I ran across a sample that sends random data over UDP port 53, and dpkt.dns.DNS was raising IndexError when this happened. I sat down and improved the unpack_name implementation.

The new implementation: * is not recursive. * detects pointer loops as soon as possible and raises UnpackError. * always raises dpkt.UnpackError when the packet is malformed in some way. * uses '.'.join() to build the return value instead of repeatedly appending to a string.

This resulted in a series of patches (unit tests and the actual implementation).

Attachment: 0001-Unit-test-demonstrating-IndexError-for-DNS-random-da.patch 0002-Add-test-case-for-circular-pointers.patch 0003-Add-unit-test-for-very-long-names.patch 0004-Improved-unpack_name-implementation.patch

Original issue: http://code.google.com/p/dpkt/issues/detail?id=120

kbandla avatar Jun 04 '15 03:06 kbandla

@sunhao2014 so does PR #214 close this issue, if so please close.

brifordwylie avatar Aug 17 '16 02:08 brifordwylie