aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/powerd
diff options
context:
space:
mode:
authorChristian Brueffer <brueffer@FreeBSD.org>2014-02-11 15:16:49 +0000
committerChristian Brueffer <brueffer@FreeBSD.org>2014-02-11 15:16:49 +0000
commita051bcb130a9800fed6359119cfec0524e43cf13 (patch)
tree457c7cc2aa8d4f77dd9a1e30f23360b390fe848e /usr.sbin/powerd
parentcadf3831b3d1d00c710fb47e5106596c3a34bc2c (diff)
downloadsrc-a051bcb130a9800fed6359119cfec0524e43cf13.tar.gz
src-a051bcb130a9800fed6359119cfec0524e43cf13.zip
In acline_init(), initialize ac_line to SRC_UNKNOWN. Previously
this could lead to the -n option effectively being ignored (in case ac_line happened to be 0 aka SRC_AC), or other undefined behaviour. PR: 169779 Submitted by: Alex Gonzalez <loox at e-shell.net> Reviewed by: jhb MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=261773
Diffstat (limited to 'usr.sbin/powerd')
-rw-r--r--usr.sbin/powerd/powerd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.sbin/powerd/powerd.c b/usr.sbin/powerd/powerd.c
index 2c6eac2dff2f..3f628f6a30c9 100644
--- a/usr.sbin/powerd/powerd.c
+++ b/usr.sbin/powerd/powerd.c
@@ -279,6 +279,7 @@ static void
acline_init(void)
{
acline_mib_len = 4;
+ acline_status = SRC_UNKNOWN;
if (sysctlnametomib(ACPIAC, acline_mib, &acline_mib_len) == 0) {
acline_mode = ac_sysctl;