summaryrefslogtreecommitdiff
path: root/usr.sbin/tcpdump
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-04-07 05:16:53 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-04-07 05:16:53 +0000
commit3a49d3d9a963b8830117e24adf86261ba45e7e02 (patch)
tree47d35cf12b7d4aeb3b0f6050dc0633cbafc323f5 /usr.sbin/tcpdump
parentc2e7a1e6a35d9e7f2e0b3bb66f06b0f146887c4d (diff)
Add default case to prevent uninitialized variable usage, although
moritz@ says ``this can't happen, because no fmt string passed to fdata() uses a T-value not caught by the switch.'' From NetBSD from Coverity CID 2491. OK otto@ and moritz@
Diffstat (limited to 'usr.sbin/tcpdump')
-rw-r--r--usr.sbin/tcpdump/smbutil.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/tcpdump/smbutil.c b/usr.sbin/tcpdump/smbutil.c
index fe2637cd9c1..f01c39806b5 100644
--- a/usr.sbin/tcpdump/smbutil.c
+++ b/usr.sbin/tcpdump/smbutil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smbutil.c,v 1.3 2001/11/07 18:48:16 deraadt Exp $ */
+/* $OpenBSD: smbutil.c,v 1.4 2006/04/07 05:16:52 ray Exp $ */
/*
Copyright (C) Andrew Tridgell 1995-1999
@@ -13,7 +13,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/smbutil.c,v 1.3 2001/11/07 18:48:16 deraadt Exp $";
+ "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/smbutil.c,v 1.4 2006/04/07 05:16:52 ray Exp $";
#endif
#include <sys/param.h>
@@ -493,6 +493,9 @@ static const uchar *fdata1(const uchar *buf, const char *fmt, const uchar *maxbu
t = interpret_long_date(buf);
buf+=8;
break;
+ default:
+ t = 0;
+ break;
}
printf("%s",t?asctime(localtime(&t)):"NULL ");
fmt++; while (isdigit(*fmt)) fmt++;