]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
pfctl: Fix uninitialised veriable
authorkp <kp@FreeBSD.org>
Sun, 1 Nov 2015 17:20:17 +0000 (17:20 +0000)
committerkp <kp@FreeBSD.org>
Sun, 1 Nov 2015 17:20:17 +0000 (17:20 +0000)
In pfctl_set_debug() we used 'level' without ever initialising it.
We correctly parsed the option, but them failed to actually assign the parsed
value to 'level' before performing to ioctl() to configure the debug level.

PR: 202996
Submitted by: Andrej Kolontai

sbin/pfctl/pfctl.c

index ea0064b02b7e2d42e7de6ba6d32e8613feeb5594..43d9dc56a8eda15cdd9e5db9d31c7b50707243c6 100644 (file)
@@ -1840,6 +1840,7 @@ pfctl_set_debug(struct pfctl *pf, char *d)
        }
 
        pf->debug_set = 1;
+       level = pf->debug;
 
        if ((pf->opts & PF_OPT_NOACTION) == 0)
                if (ioctl(dev, DIOCSETDEBUG, &level))