]> The Tcpdump Group git mirrors - tcpdump/commit
ospf: add more length checks.
authorGuy Harris <[email protected]>
Sun, 25 Feb 2024 09:26:17 +0000 (01:26 -0800)
committerGuy Harris <[email protected]>
Sun, 25 Feb 2024 09:26:17 +0000 (01:26 -0800)
commitc27f2440fdbca0d14809df2fe656c5c5e496e3f3
treed10ee0b7812dbde90a00bf61e4418ea906744394
parentdb62b0176b7cbf3353182f0b0adfdea16c8a5baf
ospf: add more length checks.

Always make sure that a TLV doesn't go past the end of the LSA in which
it's contained and that a subTLV doesn't go past the end of the TLV in
which it's contained, before processing the TLV or subTLV data.

If we have to pad the TLV or subTLV length, make sure that's true
*after* we pad it, as well - and don't bother doing that check if we
*don't* pad it.

If the subTLV length is greater than the remaining data in the TLV,
report that using the subTLV and remaining data lengths, not those
lengths + 4.
print-ospf.c