Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Feb 2014 15:16:50 +0000 (UTC)
From:      Christian Brueffer <brueffer@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r261773 - head/usr.sbin/powerd
Message-ID:  <201402111516.s1BFGoKO045938@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brueffer
Date: Tue Feb 11 15:16:49 2014
New Revision: 261773
URL: http://svnweb.freebsd.org/changeset/base/261773

Log:
  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

Modified:
  head/usr.sbin/powerd/powerd.c

Modified: head/usr.sbin/powerd/powerd.c
==============================================================================
--- head/usr.sbin/powerd/powerd.c	Tue Feb 11 13:33:03 2014	(r261772)
+++ head/usr.sbin/powerd/powerd.c	Tue Feb 11 15:16:49 2014	(r261773)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402111516.s1BFGoKO045938>