]> The Tcpdump Group git mirrors - tcpdump/commit
NTP: Improve length checks.
authorDenis Ovsienko <[email protected]>
Wed, 30 Aug 2017 12:42:22 +0000 (13:42 +0100)
committerDenis Ovsienko <[email protected]>
Wed, 30 Aug 2017 12:53:56 +0000 (13:53 +0100)
commit0559dc98748bac47c062c0c33faec2cae44f6fa0
tree16802331e3f17863fa6c2477030296834c4c6fe5
parentbd3f9392a6197020d81cd11be3eb64f5906acb48
NTP: Improve length checks.

In ntp_print() add a missing length check to reject packets that are
declared too short, make the existing length checks easier to follow and
add a catch-all block after the known message layouts.

This fixes a bug where an invalid packet could be erroneously printed
like it is valid so long as the provided buffer was large enough. That
said, the bounds checks were done correctly so there was no over-read.
print-ntp.c