Page MenuHomeFreeBSD

D57522.diff
No OneTemporary

D57522.diff

diff --git a/sys/compat/linuxkpi/common/src/linux_simple_attr.c b/sys/compat/linuxkpi/common/src/linux_simple_attr.c
--- a/sys/compat/linuxkpi/common/src/linux_simple_attr.c
+++ b/sys/compat/linuxkpi/common/src/linux_simple_attr.c
@@ -163,15 +163,12 @@
if (*ppos != 0 || write_size < 1)
return (-EINVAL);
- buf = malloc(write_size, M_LSATTR, M_WAITOK);
+ buf = malloc(write_size + 1, M_LSATTR, M_WAITOK);
if (copy_from_user(buf, ubuf, write_size) != 0) {
free(buf, M_LSATTR);
return (-EFAULT);
}
- if (strnlen(buf, write_size) == write_size) {
- free(buf, M_LSATTR);
- return (-EINVAL);
- }
+ buf[write_size] = '\0';
mutex_lock(&sattr->mutex);

File Metadata

Mime Type
text/plain
Expires
Sun, Jun 14, 6:03 AM (16 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33878284
Default Alt Text
D57522.diff (670 B)

Event Timeline