From a5218360a34fff284dc9e0f1d31dde794261fc3e Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 5 Nov 2024 10:38:16 +0100 Subject: [PATCH] docker: add check for too many parts Signed-off-by: Giuseppe Scrivano --- docker/docker_image_src.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/docker_image_src.go b/docker/docker_image_src.go index 6e44ce0960..41ab9bfd16 100644 --- a/docker/docker_image_src.go +++ b/docker/docker_image_src.go @@ -340,6 +340,10 @@ func handle206Response(streams chan io.ReadCloser, errs chan error, body io.Read } return } + if parts >= len(chunks) { + errs <- errors.New("too many parts returned by the server") + break + } s := signalCloseReader{ closed: make(chan struct{}), stream: p,