Add an explicit check for a malformed AS segment with (segment length 0),
authorsthen <sthen@openbsd.org>
Tue, 20 Oct 2015 11:29:07 +0000 (11:29 +0000)
committersthen <sthen@openbsd.org>
Tue, 20 Oct 2015 11:29:07 +0000 (11:29 +0000)
commit73dbf992adf8369b780bc4d92138e30e57ab2a33
tree7c7fb04257a66af5ab7ed6043bf73dbb2c671ec9
parentfb6469ec318348e9bf0963dcd01c854a59d9bc8b
Add an explicit check for a malformed AS segment with (segment length 0),
avoiding division by zero when deciding whether it contains 2- or 4-byte ASNs.
Refactor TCHECK calls to ensure proper coverage.

From Kevin Reay, ok canacar with wording tweak (I used "malformed" rather
than canacar's suggested "invalid size" or Kevin's original "empty").
usr.sbin/tcpdump/print-bgp.c