Skip to content

Commit

Permalink
Fix SIGSEGV in S3StorageInteractor.ListPath.
Browse files Browse the repository at this point in the history
When source S3 bucket have been deleted we receive SignatureDoesNotMatch error when trying to
list objects in bucket. This error wasn't handled properly, so it lead to nil-reference dereference
in next line. (Also, yp-client showed `failed to read params: EOF` to client)
  • Loading branch information
ostinru committed Oct 12, 2024
1 parent b5217c2 commit 6615204
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/proc/interaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func ProcessPutExtended(
return
} else if n != int(msg.Sz) {

_ = ycl.ReplyError(fmt.Errorf("unfull write"), "failed to compelete request")
_ = ycl.ReplyError(fmt.Errorf("unfull write"), "failed to complete request")

return
}
Expand Down Expand Up @@ -177,7 +177,7 @@ func ProcessListExtended(msg message.ListMessage, s storage.StorageInteractor, c

objectMetas, err := s.ListPath(msg.Prefix)
if err != nil {
_ = ycl.ReplyError(fmt.Errorf("could not list objects: %s", err), "failed to compelete request")
_ = ycl.ReplyError(fmt.Errorf("could not list objects: %s", err), "failed to complete request")

return nil
}
Expand Down
1 change: 1 addition & 0 deletions pkg/storage/s3storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ func (s *S3StorageInteractor) ListPath(prefix string) ([]*object.ObjectInfo, err
out, err := sess.ListObjectsV2(input)
if err != nil {
fmt.Printf("list error: %v\n", err)
return nil, err
}

for _, obj := range out.Contents {
Expand Down

0 comments on commit 6615204

Please sign in to comment.