From: Jouni Malinen Date: Tue, 7 Jul 2015 12:39:08 +0000 (+0300) Subject: radiotap: Avoid ubsan warning on 1<<31 X-Git-Tag: hostap_2_5~464 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f5fb8a46751a1b4171314992b908864fedcc776;p=thirdparty%2Fhostap.git radiotap: Avoid ubsan warning on 1<<31 Use the BIT() macro and unsigned int to avoid ubsan warning on 1<<31 not fitting in an int. Signed-off-by: Jouni Malinen --- diff --git a/src/utils/radiotap.c b/src/utils/radiotap.c index f8f815a86..c9a502335 100644 --- a/src/utils/radiotap.c +++ b/src/utils/radiotap.c @@ -123,13 +123,13 @@ int ieee80211_radiotap_iterator_init( /* find payload start allowing for extended bitmap(s) */ - if (iterator->_bitmap_shifter & (1<_bitmap_shifter & BIT(IEEE80211_RADIOTAP_EXT)) { if ((unsigned long)iterator->_arg - (unsigned long)iterator->_rtheader + sizeof(uint32_t) > (unsigned long)iterator->_max_length) return -EINVAL; while (get_unaligned_le32(iterator->_arg) & - (1 << IEEE80211_RADIOTAP_EXT)) { + BIT(IEEE80211_RADIOTAP_EXT)) { iterator->_arg += sizeof(uint32_t); /*