Skip to content

Commit

Permalink
Guard against errors on bioutil (#573)
Browse files Browse the repository at this point in the history
Some machines don't return output from `bioutil`. In that case, don't parse it.
  • Loading branch information
directionless authored Feb 18, 2020
1 parent fb06e1b commit d99e581
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/osquery/table/touchid_system_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ func (t *touchIDSystemConfigTable) generate(ctx context.Context, queryContext ta
}
configOutStr := string(stdout.Bytes())
configSplit := strings.Split(configOutStr, ":")
touchIDEnabled = configSplit[2][1:2]
touchIDUnlock = configSplit[3][1:2]
if len(configSplit) >= 3 {
touchIDEnabled = configSplit[2][1:2]
touchIDUnlock = configSplit[3][1:2]
}

result := map[string]string{
"touchid_compatible": touchIDCompatible,
Expand Down

0 comments on commit d99e581

Please sign in to comment.