|
@@ -40,9 +40,11 @@ static ssize_t exitcode_proc_write(struct file *file,
|
|
|
const char __user *buffer, size_t count, loff_t *pos)
|
|
|
{
|
|
|
char *end, buf[sizeof("nnnnn\0")];
|
|
|
+ size_t size;
|
|
|
int tmp;
|
|
|
|
|
|
- if (copy_from_user(buf, buffer, count))
|
|
|
+ size = min(count, sizeof(buf));
|
|
|
+ if (copy_from_user(buf, buffer, size))
|
|
|
return -EFAULT;
|
|
|
|
|
|
tmp = simple_strtol(buf, &end, 0);
|