From 661b2c16830b5489aed79015cb5e7a5bfff507fb Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Wed, 22 Jan 2003 00:34:22 +0000 Subject: [PATCH] Fix what I think is an off-by-one in certain worst-case scenarios caused by rev 1.45. (eg: the estimate being exactly half of the result.) --- sbin/sysctl/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 927e7a4864c5..d843d84280a0 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -552,7 +552,7 @@ show_var(int *oid, int nlen) i = sysctl(oid, nlen, 0, &j, 0, 0); j += j; /* we want to be sure :-) */ - val = alloca(j); + val = alloca(j + 1); len = j; i = sysctl(oid, nlen, val, &len, 0, 0); if (i || !len)