Commit 9ee81443 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

staging: wilc1000: prevent some overflows in debugfs

Add some limits here so we don't corrupt memory.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d35ebe80
......@@ -53,6 +53,9 @@ static ssize_t wilc_debug_level_write(struct file *filp, const char *buf, size_t
char buffer[128] = {};
int flag = 0;
if (count > sizeof(buffer))
return -EINVAL;
if (copy_from_user(buffer, buf, count)) {
return -EFAULT;
}
......@@ -99,6 +102,9 @@ static ssize_t wilc_debug_region_write(struct file *filp, const char *buf, size_
char buffer[128] = {};
int flag;
if (count > sizeof(buffer))
return -EINVAL;
if (copy_from_user(buffer, buf, count)) {
return -EFAULT;
}
......
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