From 882c53be505cf8ea5af43c620b66f31dbe67e06a Mon Sep 17 00:00:00 2001 From: Sreeramya Soratkal Date: Fri, 9 Jul 2021 16:20:12 +0530 Subject: [PATCH] P2P: Avoid integer overflow in channel For some 6 GHz operating class like 134, there is a possibility where the ch variable used for channel iterator overflows when it is incremented. Fix this by updating the datatype of ch variable to avoid integer overflow while incrementing. Signed-off-by: Sreeramya Soratkal --- wpa_supplicant/p2p_supplicant.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 2e506867e..1e70ad6d1 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -3818,7 +3818,7 @@ static int wpas_p2p_setup_channels(struct wpa_supplicant *wpa_s, for (op = 0; global_op_class[op].op_class; op++) { const struct oper_class_map *o = &global_op_class[op]; - u8 ch; + unsigned int ch; struct p2p_reg_class *reg = NULL, *cli_reg = NULL; if (o->p2p == NO_P2P_SUPP ||