fortify/print: skip nil filesystem entries
All checks were successful
Tests / Go tests (push) Successful in 31s
Nix / NixOS tests (push) Successful in 3m24s

This fixes a panic when displaying configurations with nil filesystem entries.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
Ophestra 2024-12-28 12:14:42 +09:00
parent 85e5b097fd
commit c70f0612ad
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q

View File

@ -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")