if (len < sizeof(struct sflow_datagram_t)) {
ND_TCHECK(sflow_datagram->version);
ND_PRINT((ndo, "sFlowv%u", EXTRACT_32BITS(sflow_datagram->version)));
- ND_PRINT((ndo, " [length %u < %" PRIsize "]",
+ ND_PRINT((ndo, " [length %u < %zu]",
len, sizeof(struct sflow_datagram_t)));
ND_PRINT((ndo, " (invalid)"));
return;
/* skip Common header */
tptr += sizeof(const struct sflow_datagram_t);
+
+ if(tlen <= sizeof(const struct sflow_datagram_t)) goto trunc;
tlen -= sizeof(const struct sflow_datagram_t);
while (nsamples > 0 && tlen > 0) {