- fixed buffers size
This commit is contained in:
parent
8d67347001
commit
ed8f1d31a7
@ -33,7 +33,8 @@ static ssize_t universe_read(struct file *file, char __user *buf, size_t count,
|
||||
}
|
||||
len = strlen(answer);
|
||||
sst_debug("About to copy %lu bytes of your answer at 0x%lx to the userspace\n", len, (uintptr_t)answer);
|
||||
if (copy_to_user(buf, answer, len)) {
|
||||
size_t toCopy = min(count, len);
|
||||
if (copy_to_user(buf, answer, toCopy)) {
|
||||
pr_err("User copy failed!\n");
|
||||
kfree(answer);
|
||||
return -EFAULT;
|
||||
|
Loading…
Reference in New Issue
Block a user