]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-802_11.c
Update from current NetBSD version of ieee80211_radiotap.h.
[tcpdump] / print-802_11.c
index 6f7818bc9be31f6fc8c3f44ec9e5c0026da2e692..891439e0373a7ce3e1f614315c2e3b541d0629c4 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.31.2.7 2005-11-13 12:07:44 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.31.2.10 2005-11-13 20:23:09 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -167,7 +167,7 @@ parse_elements(struct mgmt_body_t *pbody, const u_char *p, int offset)
 
        for (;;) {
                if (!TTEST2(*(p + offset), 1))
-                       return 1;
+                       return;
                switch (*(p + offset)) {
                case E_SSID:
                        /* Present, possibly truncated */
@@ -177,7 +177,8 @@ parse_elements(struct mgmt_body_t *pbody, const u_char *p, int offset)
                        memcpy(&pbody->ssid, p + offset, 2);
                        offset += 2;
                        if (pbody->ssid.length != 0) {
-                               if (pbody->ssid.length > 32)
+                               if (pbody->ssid.length >
+                                   sizeof(pbody->ssid.ssid) - 1)
                                        return;
                                if (!TTEST2(*(p + offset), pbody->ssid.length))
                                        return;
@@ -196,8 +197,9 @@ parse_elements(struct mgmt_body_t *pbody, const u_char *p, int offset)
                                return;
                        memcpy(&pbody->challenge, p + offset, 2);
                        offset += 2;
-                       if (pbody->challenge.length == 0) {
-                               if (pbody->challenge.length > 253)
+                       if (pbody->challenge.length != 0) {
+                               if (pbody->challenge.length >
+                                   sizeof(pbody->challenge.text) - 1)
                                        return;
                                if (!TTEST2(*(p + offset), pbody->challenge.length))
                                        return;
@@ -262,7 +264,7 @@ parse_elements(struct mgmt_body_t *pbody, const u_char *p, int offset)
 
                        if (pbody->tim.length <= 3)
                                break;
-                       if (pbody->rates.length > 251)
+                       if (pbody->rates.length > sizeof pbody->tim.bitmap)
                                return;
                        if (!TTEST2(*(p + offset), pbody->tim.length - 3))
                                return;