diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-04-07 21:39:46 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-04-07 21:39:46 +0900 |
| commit | b5eff27c4069cdee7733d58207a8bbef69948b26 (patch) | |
| tree | b9b24ead9908748deea0153df447db4b59f9a4be /print.go | |
| parent | 74ba18325684ad7172b5d7f04c3a9f46ea6ab9a0 (diff) | |
fortify: check fst id string length
This should never be a problem, however in case it happens printing a warning message is better than relying on the runtime to panic.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'print.go')
| -rw-r--r-- | print.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -256,6 +256,12 @@ func printPs(output io.Writer, now time.Time, s state.Store, short, flagJSON boo t.Println("\tInstance\tPID\tApplication\tUptime") for _, e := range exp { + if len(e.s) != 1<<5 { + // unreachable + log.Printf("possible store corruption: invalid instance string %s", e.s) + continue + } + as := "(No configuration information)" if e.Config != nil { as = strconv.Itoa(e.Config.Confinement.AppID) |
