]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Don't return value from a filed cpack_uint8() call.
authorGuy Harris <[email protected]>
Tue, 5 Apr 2011 04:30:22 +0000 (21:30 -0700)
committerGuy Harris <[email protected]>
Tue, 5 Apr 2011 04:30:22 +0000 (21:30 -0700)
If the cpack_uint8() call to fetch the flags for
IEEE80211_RADIOTAP_FLAGS fails, don't return u.u8, as we didn't fetch
anything into it.

print-802_11.c

index e29b8fb846f69c18d372ff46736264533b1f2c51..81e0332ee94a8952067061f1ff68a968367f3f6f 100644 (file)
@@ -1477,6 +1477,8 @@ print_radiotap_field(struct cpack_state *s, u_int32_t bit, u_int8_t *flags)
        switch (bit) {
        case IEEE80211_RADIOTAP_FLAGS:
                rc = cpack_uint8(s, &u.u8);
+               if (rc != 0)
+                       break;
                *flags = u.u8;
                break;
        case IEEE80211_RADIOTAP_RATE: