mirror of
https://github.com/versity/versitygw.git
synced 2026-07-19 14:32:20 +00:00
422b5a7024
ParseCopySource indexes into copySourceHeader[0] without checking for an empty string, causing an index-out-of-range panic. The three backend callers (azure, posix) pass the x-amz-copy-source header value directly, so a malformed or missing header propagates an empty string into ParseCopySource. Add an empty-string guard at the top of the function that returns an InvalidArgCopySourceBucket error, consistent with the existing error returned when the source path has no bucket/object separator. Add a table-driven test case that reproduces the panic without the fix and verifies the correct error with the fix. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>