From 3a49d3d9a963b8830117e24adf86261ba45e7e02 Mon Sep 17 00:00:00 2001 From: Ray Lai Date: Fri, 7 Apr 2006 05:16:53 +0000 Subject: 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@ --- usr.sbin/tcpdump/smbutil.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'usr.sbin') 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 @@ -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++; -- cgit v1.2.3