Skip to content

Commit

Permalink
Add limit to number of manifests
Browse files Browse the repository at this point in the history
Signed-off-by: AdamKorcz <[email protected]>
  • Loading branch information
AdamKorcz committed Oct 25, 2023
1 parent cd0bc6a commit 796b298
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/docker/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ func GetPlatformImage(ref, platform string) (string, error) {
return "", fmt.Errorf("cannot get index manifest: %w", err)
}

if len(idxMft.Manifests) > 1000 {
return "", fmt.Errorf("platform image has too many manifests")
}

for _, manifest := range idxMft.Manifests {
if plat.OS == manifest.Platform.OS &&
plat.Architecture == manifest.Platform.Architecture {
Expand Down

0 comments on commit 796b298

Please sign in to comment.