diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-01-22 08:20:16 -0800 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-01-22 08:23:15 -0800 |
commit | b4810773754fe8371d17b1be49b1c15e8d9d4547 (patch) | |
tree | e9de3badeca3973ed3ec27f5ef578ca7c519de2b /drivers/input | |
parent | a535a9f16cc39b978857d584d6e5fb9840db7db7 (diff) | |
download | blackbird-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.c | 2 |
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; } |