From 5250f1bab59f208de6a024f187c684614d3e2d21 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 29 Aug 2023 08:50:07 +0200 Subject: [PATCH] cli/registry: fix client.pullManifestList not de-referencing manifest Kudos to gosec; cli/registry/client/fetcher.go:205:57: G601: Implicit memory aliasing in for loop. (gosec) imageManifest.Descriptor.Platform = types.OCIPlatform(&manifestDescriptor.Platform) ^ Signed-off-by: Sebastiaan van Stijn --- cli/registry/client/fetcher.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/registry/client/fetcher.go b/cli/registry/client/fetcher.go index acae274a44..9b362ba894 100644 --- a/cli/registry/client/fetcher.go +++ b/cli/registry/client/fetcher.go @@ -202,7 +202,8 @@ func pullManifestList(ctx context.Context, ref reference.Named, repo distributio } // Replace platform from config - imageManifest.Descriptor.Platform = types.OCIPlatform(&manifestDescriptor.Platform) + p := manifestDescriptor.Platform + imageManifest.Descriptor.Platform = types.OCIPlatform(&p) infos = append(infos, imageManifest) }