mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2025-01-21 15:18:15 +08:00
sFlow: Add a length check
This commit is contained in:
parent
40f1cf8aa7
commit
09822d484b
@ -872,6 +872,13 @@ sflow_print(netdissect_options *ndo,
|
|||||||
tptr = pptr;
|
tptr = pptr;
|
||||||
tlen = len;
|
tlen = len;
|
||||||
sflow_datagram = (const struct sflow_datagram_t *)pptr;
|
sflow_datagram = (const struct sflow_datagram_t *)pptr;
|
||||||
|
if (len < sizeof(struct sflow_datagram_t)) {
|
||||||
|
ND_PRINT("sFlowv%u", GET_BE_U_4(sflow_datagram->version));
|
||||||
|
ND_PRINT(" [length %u < %" PRIsize "]",
|
||||||
|
len, sizeof(struct sflow_datagram_t));
|
||||||
|
nd_print_invalid(ndo);
|
||||||
|
return;
|
||||||
|
}
|
||||||
ND_TCHECK_SIZE(sflow_datagram);
|
ND_TCHECK_SIZE(sflow_datagram);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user