Skip to content

Commit 8e3c836

Browse files
authored
Merge pull request moby#5606 from tonistiigi/solver-walkprovenance-deref
solver: protect against nil dereference on uninitialized vertex
2 parents eae2546 + 983a32b commit 8e3c836

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

solver/jobs.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -734,10 +734,12 @@ func (j *Job) walkProvenance(ctx context.Context, e Edge, f func(ProvenanceProvi
734734
visited[e.Vertex.Digest()] = struct{}{}
735735
if st, ok := j.list.actives[e.Vertex.Digest()]; ok {
736736
st.mu.Lock()
737-
if wp, ok := st.op.op.(ProvenanceProvider); ok {
738-
if err := f(wp); err != nil {
739-
st.mu.Unlock()
740-
return err
737+
if st.op != nil && st.op.op != nil {
738+
if wp, ok := st.op.op.(ProvenanceProvider); ok {
739+
if err := f(wp); err != nil {
740+
st.mu.Unlock()
741+
return err
742+
}
741743
}
742744
}
743745
st.mu.Unlock()

0 commit comments

Comments
 (0)