summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-01-22 08:20:16 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-01-22 08:23:15 -0800
commitb4810773754fe8371d17b1be49b1c15e8d9d4547 (patch)
treee9de3badeca3973ed3ec27f5ef578ca7c519de2b /drivers/input
parenta535a9f16cc39b978857d584d6e5fb9840db7db7 (diff)
downloadblackbird-op-linux-b4810773754fe8371d17b1be49b1c15e8d9d4547.tar.gz
blackbird-op-linux-b4810773754fe8371d17b1be49b1c15e8d9d4547.zip
Input: cyapa - off by one in cyapa_update_fw_store()
If "(count == NAME_MAX)" then we could end up putting the NUL terminator one space beyond the end of the fw_name[] array. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/mouse/cyapa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c
index 64c6128304cf..58f4f6fa4857 100644
--- a/drivers/input/mouse/cyapa.c
+++ b/drivers/input/mouse/cyapa.c
@@ -1013,7 +1013,7 @@ static ssize_t cyapa_update_fw_store(struct device *dev,
char fw_name[NAME_MAX];
int ret, error;
- if (count > NAME_MAX) {
+ if (count >= NAME_MAX) {
dev_err(dev, "File name too long\n");
return -EINVAL;
}
OpenPOWER on IntegriCloud