linuxkpi: seq_read: Fix off by one error
strscpy needs the buffer length not the string length (so including
the '\0').
Reviewed by: bz
Fixes: f697b9432d
("linuxkpi: drm-kmod debugfs support")
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D37771
This commit is contained in:
parent
2e08e4b75e
commit
ccd8c4488a
@ -67,7 +67,7 @@ seq_read(struct linux_file *f, char *ubuf, size_t size, off_t *ppos)
|
||||
return (-EINVAL);
|
||||
|
||||
size = min(rc - *ppos, size);
|
||||
rc = strscpy(ubuf, sbuf_data(sbuf) + *ppos, size);
|
||||
rc = strscpy(ubuf, sbuf_data(sbuf) + *ppos, size + 1);
|
||||
|
||||
/* add 1 for null terminator */
|
||||
if (rc > 0)
|
||||
|
Loading…
Reference in New Issue
Block a user