From: guy Date: Thu, 13 Sep 2007 18:03:49 +0000 (+0000) Subject: From Chris Larson: don't cut off the last byte of the chunk payload. X-Git-Tag: tcpdump-4.0.0~81 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/735692ad425ae79d2d388826d63fcdc33a8d1674 From Chris Larson: don't cut off the last byte of the chunk payload. --- diff --git a/CREDITS b/CREDITS index 1f62ade6..12878c5e 100644 --- a/CREDITS +++ b/CREDITS @@ -35,6 +35,7 @@ Additional people who have contributed patches: Chris Cogdon Chris G. Demetriou Chris Jepeway + Chris Larson Craig Rodrigues Crist J. Clark Daniel Hagerty diff --git a/print-sctp.c b/print-sctp.c index d38cfde2..05c753a5 100644 --- a/print-sctp.c +++ b/print-sctp.c @@ -35,7 +35,7 @@ #ifndef lint static const char rcsid[] _U_ = -"@(#) $Header: /tcpdump/master/tcpdump/print-sctp.c,v 1.20 2005-07-07 01:22:20 guy Exp $ (NETLAB/PEL)"; +"@(#) $Header: /tcpdump/master/tcpdump/print-sctp.c,v 1.21 2007-09-13 18:03:49 guy Exp $ (NETLAB/PEL)"; #endif #ifdef HAVE_CONFIG_H @@ -206,6 +206,7 @@ void sctp_print(const u_char *bp, /* beginning of sctp packet */ if (htons(chunkDescPtr->chunkLength) < sizeof(struct sctpDataPart)+ sizeof(struct sctpChunkDesc)+1) { + /* Less than 1 byte of chunk payload */ printf("bogus chunk length %u]", htons(chunkDescPtr->chunkLength)); return; @@ -213,7 +214,7 @@ void sctp_print(const u_char *bp, /* beginning of sctp packet */ default_print(payloadPtr, htons(chunkDescPtr->chunkLength) - (sizeof(struct sctpDataPart)+ - sizeof(struct sctpChunkDesc)+1)); + sizeof(struct sctpChunkDesc))); } else printf("]"); }