fix(simplestorage): use lower helper for safe pointer dereferencing#21
Merged
fix(simplestorage): use lower helper for safe pointer dereferencing#21
Conversation
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>
4860d03 to
5da3aef
Compare
Contributor
There was a problem hiding this comment.
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
Putmethod to safely dereferenceETagandVersionIdresponse fields - Updated
Listmethod to safely dereferenceNextContinuationTokenresponse field - Updated
ListBucketsmethod to safely dereference bucketNameandContinuationTokenresponse 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
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>
|
🎉 This PR is included in version 0.4.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lowerhelper functionDetails
Affected functions:
Put: Etag and VersionId fieldsList: NextContinuationToken fieldListBuckets: bucket Name and ContinuationToken fieldsThis makes the code consistent with other methods like
GetandHeadwhich already use thelowerhelper for optional pointer fields.Test plan
go build ./...npm run formatgo test ./...Fixes potential nil pointer panics in simplestorage package.