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>
This commit is contained in:
Dan Carpenter 2015-01-22 08:20:16 -08:00 committed by Dmitry Torokhov
parent a535a9f16c
commit b481077375
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}