NFC: Use NFC_MAX_GT_LEN to check len in nci_set_local_general_bytes

local_gb is of size NFC_MAX_GT_LEN and len is used as index for it.
Check len against this instead of NCI_MAX_PARAM_LEN before accessing
local_gb.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Szymon Janc 2012-10-04 15:15:45 +02:00 committed by Samuel Ortiz
parent 7ad39395ab
commit 460d8f970e
1 changed files with 1 additions and 1 deletions

View File

@ -420,7 +420,7 @@ static int nci_set_local_general_bytes(struct nfc_dev *nfc_dev)
if ((param.val == NULL) || (param.len == 0))
return rc;
if (param.len > NCI_MAX_PARAM_LEN)
if (param.len > NFC_MAX_GT_LEN)
return -EINVAL;
for (i = 0; i < param.len; i++)