aboutsummaryrefslogtreecommitdiff
path: root/sbin/sysctl
diff options
context:
space:
mode:
authorMatthew N. Dodd <mdodd@FreeBSD.org>2005-04-13 06:56:31 +0000
committerMatthew N. Dodd <mdodd@FreeBSD.org>2005-04-13 06:56:31 +0000
commit9f98e452c32eef309ae6895489ea8fca3f5b4728 (patch)
tree9bf9cf824e7fdcb2b9e7e81bb4412b8d331ec630 /sbin/sysctl
parent8f6a80b79109dd8a1c1c797ac96b220c4e879ae7 (diff)
downloadsrc-9f98e452c32eef309ae6895489ea8fca3f5b4728.tar.gz
src-9f98e452c32eef309ae6895489ea8fca3f5b4728.zip
Zero buffers. Seatbelt against sysctl(3) returning non-NUL terminated
string data.
Notes
Notes: svn path=/head/; revision=144997
Diffstat (limited to 'sbin/sysctl')
-rw-r--r--sbin/sysctl/sysctl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
index 1ce20edc1e68..190a2e6fd688 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c
@@ -501,6 +501,8 @@ show_var(int *oid, int nlen)
u_int kind;
int (*func)(int, void *);
+ bzero(buf, BUFSIZ);
+ bzero(name, BUFSIZ);
qoid[0] = 0;
memcpy(qoid + 2, oid, nlen * sizeof(int));