]> The Tcpdump Group git mirrors - tcpdump/commitdiff
IEEE 802.11: Fix signedness of the flags parameters of print_chaninfo()
authorFrancois-Xavier Le Bail <[email protected]>
Wed, 1 Jul 2020 08:15:39 +0000 (10:15 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 1 Jul 2020 08:28:43 +0000 (10:28 +0200)
uint32_t for flags, because there are calls with uint16_t and uint32_t.

This change avoids (for presentflags):
print-802_11.c:2795:41: runtime error: implicit conversion from type
'uint32_t' (aka 'unsigned int') of value 2147502191 (32-bit, unsigned)
to type 'int' changed the value to -2147465105 (32-bit, signed)
    #0 0x815e130 in print_radiotap_field ./print-802_11.c:2795:41

print-802_11.c

index 7fcf3994df29168403afdb7192547bc633a28f85..270870e61a8ebc205ae232eee52dd66fe5c8e58e 100644 (file)
@@ -2642,7 +2642,7 @@ enum ieee80211_radiotap_type {
 
 static void
 print_chaninfo(netdissect_options *ndo,
-              uint16_t freq, int flags, int presentflags)
+              uint16_t freq, uint32_t flags, uint32_t presentflags)
 {
        ND_PRINT("%u MHz", freq);
        if (presentflags & (1 << IEEE80211_RADIOTAP_MCS)) {