From c70f0612ad32f9ba5dc4ecf793aa4553929372d4 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 28 Dec 2024 12:14:42 +0900 Subject: [PATCH] fortify/print: skip nil filesystem entries This fixes a panic when displaying configurations with nil filesystem entries. Signed-off-by: Ophestra --- print.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/print.go b/print.go index fb5eb36..c3126a4 100644 --- a/print.go +++ b/print.go @@ -93,6 +93,10 @@ func printShow(instance *state.State, config *fst.Config, short bool) { if !short && config.Confinement.Sandbox != nil && len(config.Confinement.Sandbox.Filesystem) > 0 { fmt.Fprintf(w, "Filesystem:\n") for _, f := range config.Confinement.Sandbox.Filesystem { + if f == nil { + continue + } + expr := new(strings.Builder) if f.Device { expr.WriteString(" d")