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
This commit is contained in:
parent
cadf3831b3
commit
a051bcb130
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=261773
@ -279,6 +279,7 @@ static void
|
|||||||
acline_init(void)
|
acline_init(void)
|
||||||
{
|
{
|
||||||
acline_mib_len = 4;
|
acline_mib_len = 4;
|
||||||
|
acline_status = SRC_UNKNOWN;
|
||||||
|
|
||||||
if (sysctlnametomib(ACPIAC, acline_mib, &acline_mib_len) == 0) {
|
if (sysctlnametomib(ACPIAC, acline_mib, &acline_mib_len) == 0) {
|
||||||
acline_mode = ac_sysctl;
|
acline_mode = ac_sysctl;
|
||||||
|
Loading…
Reference in New Issue
Block a user