Skip to content

Commit

Permalink
fix: add bounds checking to addendum layer mutations to prevent panic (
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-prindle committed May 30, 2023
1 parent c3f8a49 commit 03b8657
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/v1/mutate/mutate.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ func Time(img v1.Image, t time.Time) (v1.Image, error) {
historyIdx++
break
}
addendums[addendumIdx].Layer = newLayer
if addendumIdx < len(addendums) {
addendums[addendumIdx].Layer = newLayer
}
}

// add all leftover History entries
Expand Down

0 comments on commit 03b8657

Please sign in to comment.