diff options
author | ache <ache@FreeBSD.org> | 2002-05-08 23:49:19 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2002-05-08 23:49:19 +0000 |
commit | c5c443997d7671773163be988f02f5fe67004f14 (patch) | |
tree | 758ae1a57029c3f5659d53bf854285889b28f322 /sbin/sysctl/sysctl.c | |
parent | 8e1d7e9138a0720c8c9ba621812c51fe60646343 (diff) | |
download | FreeBSD-src-c5c443997d7671773163be988f02f5fe67004f14.zip FreeBSD-src-c5c443997d7671773163be988f02f5fe67004f14.tar.gz |
Don't forget to null-terminate string we got from sysctl (f.e. in 'A' format).
Stack garbadge may be printed otherwise.
Diffstat (limited to 'sbin/sysctl/sysctl.c')
-rw-r--r-- | sbin/sysctl/sysctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 161adbc..1b6495d 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -518,7 +518,7 @@ show_var(int *oid, int nlen) fwrite(val, 1, len, stdout); return (0); } - + val[len] = '\0'; fmt = buf; oidfmt(oid, nlen, fmt, &kind); p = val; |