[PATCH] P2P: Fix memory size for os_memmove in p2p_check_pref_chan

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Daisuke Niwa <daisuke.niwa@xxxxxxxx>

'sizeof' is not used at os_memmove for integer array. This leads
to the issue that part of preferred channel is not utilized.

Signed-off-by: Daichi Ueura <daichi.ueura@xxxxxxxx>
---
 src/p2p/p2p_go_neg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/p2p/p2p_go_neg.c b/src/p2p/p2p_go_neg.c
index 65ab4b8d3..b34702c04 100644
--- a/src/p2p/p2p_go_neg.c
+++ b/src/p2p/p2p_go_neg.c
@@ -676,7 +676,8 @@ 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(int));
 			size--;
 			continue;
 		}
-- 
2.17.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux