mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 01:18:42 +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
1 changed files with 1 additions and 1 deletions
|
|
@ -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 a new issue