From: hannes Date: Tue, 17 Jan 2006 17:43:55 +0000 (+0000) Subject: bugfix: pre-init OUI tokentable to an empty tokentable to prevent a NULL ref and... X-Git-Tag: tcpdump-4.0.0~278 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/4ee5f75b6c4c46d5e42ef8f633d9dfedd2401ac5?hp=997e4c69542f1ba6e2f4498fa633bbb2d9309d58 bugfix: pre-init OUI tokentable to an empty tokentable to prevent a NULL ref and subsequent segfault --- diff --git a/print-llc.c b/print-llc.c index 039c9f49..51e9b3cc 100644 --- a/print-llc.c +++ b/print-llc.c @@ -24,7 +24,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-llc.c,v 1.69 2005-12-01 18:05:12 hannes Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-llc.c,v 1.70 2006-01-17 17:43:55 hannes Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -121,6 +121,10 @@ static const struct tok bridged_values[] = { { 0, NULL }, }; +static const struct tok null_values[] = { + { 0, NULL } +}; + struct oui_tok { u_int32_t oui; const struct tok *tok; @@ -382,7 +386,7 @@ snap_print(const u_char *p, u_int length, u_int caplen, et = EXTRACT_16BITS(p + 3); if (eflag) { - const struct tok *tok = NULL; + const struct tok *tok = null_values; const struct oui_tok *otp; for (otp = &oui_to_tok[0]; otp->tok != NULL; otp++) {