Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solver: protect against nil dereference on uninitialized vertex #5606

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading