mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Fix panic in osquery-perf
(#14534)
This is safe to merge during freeze as this is an osquery-perf only change. ``` panic: runtime error: index out of range [1] with length 1 goroutine 14 [running]: main.(*agent).config(0xc0001e5b80) /Users/luk/fleetdm/git/fleet/cmd/osquery-perf/agent.go:847 +0xb74 main.(*agent).runLoop(0xc0001e5b80, 0x0?, 0x0?) /Users/luk/fleetdm/git/fleet/cmd/osquery-perf/agent.go:463 +0x4d2 created by main.main in goroutine 1 /Users/luk/fleetdm/git/fleet/cmd/osquery-perf/agent.go:1666 +0x1285 ```
This commit is contained in:
parent
7d13769de6
commit
8c6cefc4f4
@ -843,7 +843,7 @@ func (a *agent) config() {
|
||||
q.Name = queryName
|
||||
q.NumResults = 1
|
||||
parts := strings.Split(q.Name, "_")
|
||||
if len(parts) > 0 {
|
||||
if len(parts) == 2 {
|
||||
num, err := strconv.ParseInt(parts[1], 10, 32)
|
||||
if err != nil {
|
||||
num = 1
|
||||
|
Loading…
Reference in New Issue
Block a user