]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Fix memory size for os_memmove() in p2p_check_pref_chan()
authorDaisuke Niwa <daisuke.niwa@sony.com>
Wed, 26 Jun 2019 06:27:33 +0000 (15:27 +0900)
committerJouni Malinen <j@w1.fi>
Wed, 26 Jun 2019 17:22:33 +0000 (20:22 +0300)
'sizeof' was not used with os_memmove() for an integer array. This lead
to an issue with part of the preferred channel list not being used.

Fixes: 79329ae0aa19 ("P2P: Verify local driver preferred frequencies for P2P use cases")
Signed-off-by: Daichi Ueura <daichi.ueura@sony.com>
src/p2p/p2p_go_neg.c

index 65ab4b8d3fd6084a74c9a583276f7cb4a79de345..c94bf41a70815af2f17f37dc7313bda63819dcf6 100644 (file)
@@ -676,7 +676,9 @@ void p2p_check_pref_chan(struct p2p_data *p2p, int go,
                                "Ignore local driver frequency preference %u MHz since it is not acceptable for P2P use (go=%d)",
                                freq_list[i], go);
                        if (size - i - 1 > 0)
-                               os_memmove(&freq_list[i], &freq_list[i + 1], size - i - 1);
+                               os_memmove(&freq_list[i], &freq_list[i + 1],
+                                          (size - i - 1) *
+                                          sizeof(unsigned int));
                        size--;
                        continue;
                }