]> git.ipfire.org Git - thirdparty/hostap.git/commit
UBSan: Use typecast to avoid unsigned integer overflow
authorJouni Malinen <j@w1.fi>
Sat, 23 Feb 2019 11:44:20 +0000 (13:44 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 25 Feb 2019 17:48:46 +0000 (19:48 +0200)
commit1b85cad29c13347c2c4361c15132bd0371936e7a
treef5fc3dbb96a02e30c403df9b72530faeca7c8353
parente3b5bd81bdb666e13322248d18307317714bf461
UBSan: Use typecast to avoid unsigned integer overflow

iface->num_bss is unsigned integer, so need to explicit typecast it to
unsigned before decrementation by one even when the result is stored in
an unsigned integer.

../src/ap/hostapd.c:2185:26: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned long'

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/hostapd.c