Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177573748
D21876.1794778314.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
598 B
Referenced Files
None
Subscribers
None
D21876.1794778314.diff
View Options
Index: sys/kern/vfs_subr.c
===================================================================
--- sys/kern/vfs_subr.c
+++ sys/kern/vfs_subr.c
@@ -354,12 +354,11 @@
if (req->newlen > PATH_MAX)
return (E2BIG);
- buf = malloc(PATH_MAX + 1, M_TEMP, M_WAITOK);
+ buf = malloc(PATH_MAX, M_TEMP, M_WAITOK);
error = SYSCTL_IN(req, buf, req->newlen);
if (error != 0)
goto out;
-
- buf[req->newlen] = '\0';
+ buf[req->newlen == 0 ? 0 : req->newlen - 1] = '\0';
ndflags = LOCKLEAF | NOFOLLOW | AUDITVNODE1 | NOCACHE | SAVENAME;
NDINIT(&nd, LOOKUP, ndflags, UIO_SYSSPACE, buf, curthread);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 15, 9:31 PM (23 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41749076
Default Alt Text
D21876.1794778314.diff (598 B)
Attached To
Mode
D21876: simplify path handling in sysctl_try_reclaim_vnode
Attached
Detach File
Event Timeline