summaryrefslogtreecommitdiffstats
path: root/net/nfc/nci
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2012-10-04 15:15:45 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2012-10-26 18:26:48 +0200
commit460d8f970e44c2d8fc24ab622ff433295a6cedd8 (patch)
tree8d63fc549c09ea9daf2f09fc8fa447c0bbfe0d09 /net/nfc/nci
parent7ad39395ab1394fc6fc8bc3693d6055ea173e226 (diff)
downloadlinux-460d8f970e44c2d8fc24ab622ff433295a6cedd8.tar.gz
linux-460d8f970e44c2d8fc24ab622ff433295a6cedd8.tar.bz2
linux-460d8f970e44c2d8fc24ab622ff433295a6cedd8.zip
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>
Diffstat (limited to 'net/nfc/nci')
-rw-r--r--net/nfc/nci/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index acf9abb7d99b..77f49490e4ca 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -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++)