From 9f98e452c32eef309ae6895489ea8fca3f5b4728 Mon Sep 17 00:00:00 2001 From: "Matthew N. Dodd" Date: Wed, 13 Apr 2005 06:56:31 +0000 Subject: Zero buffers. Seatbelt against sysctl(3) returning non-NUL terminated string data. --- sbin/sysctl/sysctl.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sbin/sysctl') 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)); -- cgit v1.2.3