Skip to content

Commit

Permalink
solver: forward nil return value from sharedOp.Exec
Browse files Browse the repository at this point in the history
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 <me@jedevc.com>
  • Loading branch information
jedevc committed Aug 18, 2022
1 parent 55ba9d1 commit f45fb77
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions solver/jobs.go
Expand Up @@ -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
}

Expand Down

0 comments on commit f45fb77

Please sign in to comment.