diff options
author | avos <avos@FreeBSD.org> | 2016-03-04 21:22:11 +0000 |
---|---|---|
committer | avos <avos@FreeBSD.org> | 2016-03-04 21:22:11 +0000 |
commit | 142ebfb67e0d11187702c4c97724e63153cf9554 (patch) | |
tree | 14f2c5a03586fe9f343c0d7c832bcacc39588c05 /sys/net80211 | |
parent | 203b8c4697879659e06294fdc1a58e3d48ad5f27 (diff) | |
download | FreeBSD-src-142ebfb67e0d11187702c4c97724e63153cf9554.zip FreeBSD-src-142ebfb67e0d11187702c4c97724e63153cf9554.tar.gz |
net80211: fix possible overflow in IEEE80211_TU_TO_TICKS()
For hz=1000 any number, greater than 4194 causes integer overflow;
this change casts the number to uint64_t before operating with it.
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D5268
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_var.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h index 1dd57ee..393c7c3 100644 --- a/sys/net80211/ieee80211_var.h +++ b/sys/net80211/ieee80211_var.h @@ -85,7 +85,7 @@ #define IEEE80211_MS_TO_TU(x) (((x) * 1000) / 1024) #define IEEE80211_TU_TO_MS(x) (((x) * 1024) / 1000) /* XXX TODO: cap this at 1, in case hz is not 1000 */ -#define IEEE80211_TU_TO_TICKS(x)(((x) * 1024 * hz) / (1000 * 1000)) +#define IEEE80211_TU_TO_TICKS(x)(((uint64_t)(x) * 1024 * hz) / (1000 * 1000)) /* * 802.11 control state is split into a common portion that maps |