Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix container.Items nil ptr panic with some non-AWS impls of S3 #254

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tarndt
Copy link

@tarndt tarndt commented Dec 30, 2021

During testing using stow with some non-AWS S3 implementation's stow's container.Items panics due to a nil pointer dereference. This PR checks to ensure the said pointer object.StorageClass *string is not nil before dereferencing.

Fix:

Panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb3801e]
....
panic({0xc3e3a0, 0x1395120})
	~/go/src/runtime/panic.go:1038 +0x215
github.com/graymeta/stow/s3.(*container).Items(0xc0001fc100, {0xc0007a86f0, 0x14}, {0x0, 0x0}, 0x41)
	~/go/src/github.com/graymeta/stow/s3/container.go:63 +0x27e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant