]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-llc.c
bugfix: pre-init OUI tokentable to an empty tokentable to prevent a NULL ref and...
[tcpdump] / print-llc.c
index 039c9f4993d601bccd19287a65c3f49b01e08a85..51e9b3cc95b946c9ac8ef8b7727fcf2fd2aa81a5 100644 (file)
@@ -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++) {