summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2002-05-08 23:49:19 +0000
committerache <ache@FreeBSD.org>2002-05-08 23:49:19 +0000
commitc5c443997d7671773163be988f02f5fe67004f14 (patch)
tree758ae1a57029c3f5659d53bf854285889b28f322 /sbin
parent8e1d7e9138a0720c8c9ba621812c51fe60646343 (diff)
downloadFreeBSD-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')
-rw-r--r--sbin/sysctl/sysctl.c2
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;
OpenPOWER on IntegriCloud