[PATCH] sysctl: make sure to terminate strings with a NUL
authorLinus Torvalds <torvalds@osdl.org>
Sat, 31 Dec 2005 05:59:41 +0000 (21:59 -0800)
committerChris Wright <chrisw@sous-sol.org>
Sun, 8 Jan 2006 02:15:08 +0000 (18:15 -0800)
commit002cf2a8adbb7b9d9911f410e2db78c7a3798d14
tree5866980db57bdc4cb4320c77ec5678d851f6ca81
parenteb558037b4bb4d965eb36df1def531ce7899254e
[PATCH] sysctl: make sure to terminate strings with a NUL

This is a slightly more complete fix for the previous minimal sysctl
string fix.  It always terminates the returned string with a NUL, even
if the full result wouldn't fit in the user-supplied buffer.

The returned length is the full untruncated length, so that you can
tell when truncation has occurred.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[chrisw: inclusive of minimal fix so it's same as upstream]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
kernel/sysctl.c