X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/0f77f5da7bd07710a85c5fa0e182a7a5ca703d40..44b03896e9ebfa87fb5d60eb0ca2206707d595cf:/smbutil.c diff --git a/smbutil.c b/smbutil.c index 09ef803a..ba7ec31a 100644 --- a/smbutil.c +++ b/smbutil.c @@ -12,7 +12,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/smbutil.c,v 1.35 2004-12-30 03:36:51 guy Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/smbutil.c,v 1.39 2007-07-15 19:07:39 guy Exp $"; #endif #include @@ -279,6 +279,7 @@ print_data(const unsigned char *buf, int len) return; printf("[%03X] ", i); for (i = 0; i < len; /*nothing*/) { + TCHECK(buf[i]); printf("%02X ", buf[i] & 0xff); i++; if (i%8 == 0) @@ -310,6 +311,11 @@ print_data(const unsigned char *buf, int len) print_asc(&buf[i - n], n); printf("\n"); } + return; + +trunc: + printf("\n"); + printf("WARNING: Short packet. Try increasing the snap length\n"); } @@ -428,7 +434,6 @@ smb_fdata1(const u_char *buf, const char *fmt, const u_char *maxbuf, { int reverse = 0; const char *attrib_fmt = "READONLY|HIDDEN|SYSTEM|VOLUME|DIR|ARCHIVE|"; - int len; while (*fmt && buf