From 11d8cef14db833d31e8ec4b98ecb3f7e1cb93002 Mon Sep 17 00:00:00 2001 From: Chris Schinnerl Date: Wed, 11 Sep 2024 14:56:19 +0200 Subject: [PATCH] avoid panic in copyObject --- gofakes3.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gofakes3.go b/gofakes3.go index 4c0090d..51e400a 100644 --- a/gofakes3.go +++ b/gofakes3.go @@ -742,6 +742,9 @@ func (g *GoFakeS3) copyObject(bucket, object string, meta map[string]string, w h // XXX No support for versionId subresource parts := strings.SplitN(strings.TrimPrefix(source, "/"), "/", 2) + if len(parts) != 2 { + return ErrInvalidArgument + } srcBucket := parts[0] srcKey := strings.SplitN(parts[1], "?", 2)[0]