Commit b4810773 authored by Dan Carpenter's avatar Dan Carpenter Committed by Dmitry Torokhov

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent a535a9f1
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment