From f45fb774d4e3dbb465b15cbd06621938d4803a9a Mon Sep 17 00:00:00 2001 From: Justin Chadwell Date: Thu, 18 Aug 2022 12:16:24 +0100 Subject: [PATCH] solver: forward nil return value from sharedOp.Exec Exec could sometimes return nil, which would then result in a segmentation fault, as the code attempts to access a field in the nil result to return. This patch introduces a sanity check before accessing any parts of the field. Signed-off-by: Justin Chadwell --- solver/jobs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/solver/jobs.go b/solver/jobs.go index 38c42b533185..3c50ccf4dfbc 100644 --- a/solver/jobs.go +++ b/solver/jobs.go @@ -872,6 +872,9 @@ func (s *sharedOp) Exec(ctx context.Context, inputs []Result) (outputs []Result, return nil, nil, err } r := res.(*execRes) + if r == nil { + return nil, nil, nil + } return unwrapShared(r.execRes), r.execExporters, nil }