Skip to content

Commit

Permalink
Merge pull request #5606 from tonistiigi/solver-walkprovenance-deref
Browse files Browse the repository at this point in the history
solver: protect against nil dereference on uninitialized vertex
  • Loading branch information
AkihiroSuda authored Dec 20, 2024
2 parents eae2546 + 983a32b commit 8e3c836
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions solver/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -734,10 +734,12 @@ func (j *Job) walkProvenance(ctx context.Context, e Edge, f func(ProvenanceProvi
visited[e.Vertex.Digest()] = struct{}{}
if st, ok := j.list.actives[e.Vertex.Digest()]; ok {
st.mu.Lock()
if wp, ok := st.op.op.(ProvenanceProvider); ok {
if err := f(wp); err != nil {
st.mu.Unlock()
return err
if st.op != nil && st.op.op != nil {
if wp, ok := st.op.op.(ProvenanceProvider); ok {
if err := f(wp); err != nil {
st.mu.Unlock()
return err
}
}
}
st.mu.Unlock()
Expand Down

0 comments on commit 8e3c836

Please sign in to comment.