Skip to content

fix(simplestorage): use lower helper for safe pointer dereferencing#21

Merged
Xe merged 1 commit intomainfrom
Xe/fix-put-version-id
Jan 26, 2026
Merged

fix(simplestorage): use lower helper for safe pointer dereferencing#21
Xe merged 1 commit intomainfrom
Xe/fix-put-version-id

Conversation

@Xe
Copy link
Copy Markdown
Collaborator

@Xe Xe commented Jan 26, 2026

Summary

  • Replace unsafe raw pointer dereferencing with the lower helper function
  • Prevents potential panics when AWS SDK response fields are nil

Details

Affected functions:

  • Put: Etag and VersionId fields
  • List: NextContinuationToken field
  • ListBuckets: bucket Name and ContinuationToken fields

This makes the code consistent with other methods like Get and Head which already use the lower helper for optional pointer fields.

Test plan

  • Code compiles with go build ./...
  • Code formatted with npm run format
  • All tests pass with go test ./...

Fixes potential nil pointer panics in simplestorage package.

Copilot AI review requested due to automatic review settings January 26, 2026 20:56
@Xe Xe self-assigned this Jan 26, 2026
Replace unsafe raw pointer dereferencing with the lower helper function
to prevent potential panics when AWS SDK response fields are nil.

Affected functions:
- Put: Etag and VersionId fields
- List: NextContinuationToken field
- ListBuckets: bucket Name and ContinuationToken fields

This makes the code consistent with other methods like Get and Head
which already use the lower helper for optional pointer fields.

Assisted-by: GLM 4.7 via Claude Code
Release-status: cut
Signed-off-by: Xe Iaso <xe@tigrisdata.com>
@Xe Xe force-pushed the Xe/fix-put-version-id branch from 4860d03 to 5da3aef Compare January 26, 2026 20:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces unsafe raw pointer dereferencing with the lower helper function to prevent potential nil pointer panics in the simplestorage package. The changes make the code more defensive and consistent with existing patterns used in other methods like Get and Head.

Changes:

  • Updated Put method to safely dereference ETag and VersionId response fields
  • Updated List method to safely dereference NextContinuationToken response field
  • Updated ListBuckets method to safely dereference bucket Name and ContinuationToken response fields

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
simplestorage/client.go Replaced raw pointer dereferencing with lower() calls for Put (ETag, VersionId) and List (NextContinuationToken) methods
simplestorage/buckets.go Replaced raw pointer dereferencing with lower() calls for ListBuckets (bucket Name, ContinuationToken) method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Xe Xe merged commit 90c85ab into main Jan 26, 2026
8 checks passed
Xe pushed a commit that referenced this pull request Jan 27, 2026
## [0.4.1](v0.4.0...v0.4.1) (2026-01-27)

### Bug Fixes

* **simplestorage:** use lower helper for safe pointer dereferencing ([#21](#21)) ([90c85ab](90c85ab))

Signed-off-by: Tigris Data <social@tigrisdata.com>
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 0.4.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants