]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Avoid integer overflow in channel
authorSreeramya Soratkal <ssramya@codeaurora.org>
Fri, 9 Jul 2021 10:50:12 +0000 (16:20 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 26 Aug 2021 12:32:56 +0000 (15:32 +0300)
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>
wpa_supplicant/p2p_supplicant.c

index 2e506867e3bd08795847506cbb070ec9aac3a477..1e70ad6d19a7187c14ded753e69eb146d5c09591 100644 (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++) {
                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 ||