Skip to content

Commit

Permalink
llbsolver: fix possible panic when setting event to nil
Browse files Browse the repository at this point in the history
When a record is marked for deletion the event is set to nil
but we don't check if it's nil when sending events which could
cause a panic.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
(cherry picked from commit 9d39af0)
  • Loading branch information
crazy-max committed Nov 29, 2023
1 parent 5f41ca6 commit 020073b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion solver/llbsolver/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ func (h *HistoryQueue) Listen(ctx context.Context, req *controlapi.BuildHistoryR
}
h.mu.Unlock()
for _, e := range events {
if e.Record == nil {
if e == nil || e.Record == nil {
continue
}
if err := f(e); err != nil {
Expand Down

0 comments on commit 020073b

Please sign in to comment.