aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorAnderson Briglia <anderson.briglia@openbossa.org>2011-09-19 14:41:09 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-09-21 11:59:16 -0400
commit51beabdf624df14d0805b001d3f939629b70d9db (patch)
treea1875000da70a67f9440c2c6716e1c3be455c4b6 /net/bluetooth/hci_conn.c
parentca10b5ee0cb298f094db00dba7e397a8bc4e8398 (diff)
Bluetooth: Fix wrong memcpy size on LE start encryption
This patch fixes wrong memcpy size when copying rand value to HCI_OP_LE_START_ENC command. The compiler pretends that the array parameter was declared as a pointer and sizeof reports the size of the pointer. [1] [1] http://www.c-faq.com/aryptr/aryparmsize.html Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org> Signed-off-by: Anderson Lizardo <anderson.lizardo@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index ea7f031f3b04..c2df7bf1d374 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -218,7 +218,7 @@ void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8],
218 cp.handle = cpu_to_le16(conn->handle); 218 cp.handle = cpu_to_le16(conn->handle);
219 memcpy(cp.ltk, ltk, sizeof(cp.ltk)); 219 memcpy(cp.ltk, ltk, sizeof(cp.ltk));
220 cp.ediv = ediv; 220 cp.ediv = ediv;
221 memcpy(cp.rand, rand, sizeof(rand)); 221 memcpy(cp.rand, rand, sizeof(cp.rand));
222 222
223 hci_send_cmd(hdev, HCI_OP_LE_START_ENC, sizeof(cp), &cp); 223 hci_send_cmd(hdev, HCI_OP_LE_START_ENC, sizeof(cp), &cp);
224} 224}