]> git.ipfire.org Git - thirdparty/hostap.git/commit
UBSan: Avoid unsigned integer overflow is throughput estimation
authorJouni Malinen <j@w1.fi>
Sat, 23 Feb 2019 10:42:20 +0000 (12:42 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 25 Feb 2019 17:42:48 +0000 (19:42 +0200)
commitec2e7c4cfa171dca26977ce64953b289e2640794
treeb1657df55544ee2c5ce9b571bc6b70e54ed94252
parent3b6b3ae5813329fa69d86a553ff263bc17e8b41b
UBSan: Avoid unsigned integer overflow is throughput estimation

wpa_scan_result_compar() would return wb->est_throughput -
wa->est_throughput in case the comparison is done based on the
throughput estimates. While the return value from this function is a
signed integer, these est_throughput values are unsigned integers and
need to be explicitly typecast to avoid an UBSan warning.

scan.c:1996:30: runtime error: unsigned integer overflow: 54000 - 135000 cannot be represented in type 'unsigned int'

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/scan.c