Zero buffers. Seatbelt against sysctl(3) returning non-NUL terminated

string data.
This commit is contained in:
Matthew N. Dodd 2005-04-13 06:56:31 +00:00
parent 8f6a80b791
commit 9f98e452c3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144997

View File

@ -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));