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 <ssramya@codeaurora.org>
This commit is contained in:
Sreeramya Soratkal 2021-07-09 16:20:12 +05:30 committed by Jouni Malinen
parent a58f7e61c1
commit 882c53be50

View file

@ -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++) { for (op = 0; global_op_class[op].op_class; op++) {
const struct oper_class_map *o = &global_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; struct p2p_reg_class *reg = NULL, *cli_reg = NULL;
if (o->p2p == NO_P2P_SUPP || if (o->p2p == NO_P2P_SUPP ||