mirror of
https://github.com/versity/versitygw.git
synced 2026-07-22 16:03:22 +00:00
1a92f39b46
Both methods unconditionally dereferenced several optional *string/*int32/ *bool response fields from the upstream S3 SDK response (KeyMarker, UploadIdMarker, NextKeyMarker, NextUploadIdMarker, Delimiter, Prefix, MaxUploads/MaxParts, IsTruncated, PartNumberMarker/NextPartNumberMarker, Initiator, Owner). The AWS SDK leaves these nil whenever the corresponding XML element is absent from the response - which happens whenever the result isn't truncated (the terminal page of any pagination loop) or an optional request parameter wasn't set. This is a guaranteed panic on every completed ListParts pagination and on the common ListMultipartUploads case of a non-truncated result. Replace the unconditional dereferences with nil-safe aws.To* accessors, and default the PartNumberMarker/NextPartNumberMarker string-to-int parse to 0 when the field is absent, matching the semantics of "no marker". Verified locally against a real S3 backend: both calls previously panicked (500 InternalError) on every invocation; after this change, ListMultipartUploads, CreateMultipartUpload, UploadPart, ListParts, and AbortMultipartUpload all complete successfully with no panics.