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:
parent
a535a9f16c
commit
b481077375
|
@ -1013,7 +1013,7 @@ static ssize_t cyapa_update_fw_store(struct device *dev,
|
||||||
char fw_name[NAME_MAX];
|
char fw_name[NAME_MAX];
|
||||||
int ret, error;
|
int ret, error;
|
||||||
|
|
||||||
if (count > NAME_MAX) {
|
if (count >= NAME_MAX) {
|
||||||
dev_err(dev, "File name too long\n");
|
dev_err(dev, "File name too long\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue