dns: improve loop detection in label decompression
authorPeter Wu <peter@lekensteyn.nl>
Fri, 5 May 2017 09:46:07 +0000 (11:46 +0200)
committerPeter Wu <peter@lekensteyn.nl>
Thu, 11 May 2017 14:52:44 +0000 (14:52 +0000)
commit129bdb5a164a6386c35ff387e9d8f0d3d6a12dbf
tree59ff6aa1de70c20dde394ab1c19ea9c92b3df7d1
parent79eab8ca070f978415126f85b0777ab4ab02f0a2
dns: improve loop detection in label decompression

Previously the number of allowed pointers within a message is equal to
the data in a tvb (16575 in one example). This is still expensive, so
implement an alternative detection mechanism that looks for a direct
self-loop and limits the total pointers to about 256.

Bug: 13633
Change-Id: I803873e24ab170c7ef0b881d3bdc9dfd4014de97
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1206
Reviewed-on: https://code.wireshark.org/review/21507
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
epan/dissectors/packet-dns.c