dpkt
dpkt copied to clipboard
[patch] dns.unpack_name improvements
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).
Original issue: http://code.google.com/p/dpkt/issues/detail?id=120
@sunhao2014 so does PR #214 close this issue, if so please close.