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

gosop chokes on filenames shorter than 5 characters #22

Open
teythoon opened this issue Aug 21, 2023 · 1 comment
Open

gosop chokes on filenames shorter than 5 characters #22

teythoon opened this issue Aug 21, 2023 · 1 comment

Comments

@teythoon
Copy link

$ gosop sign foo6 <<< huhu
panic: runtime error: slice bounds out of range [:5] with length 4

goroutine 1 [running]:
github.com/ProtonMail/gosop/utils.ReadFileOrEnv({0x7fff8c1c416f?, 0x0?})
	/home/teythoon/repos/pep/openpgp-interoperability-test-suite/sops/v6/gosop/utils/utils.go:165 +0x105
github.com/ProtonMail/gosop/utils.CollectKeysPassword({0x0, 0x0, 0x0}, {0xc000119600, 0x1, 0x8?})
	/home/teythoon/repos/pep/openpgp-interoperability-test-suite/sops/v6/gosop/utils/utils.go:140 +0x8d
github.com/ProtonMail/gosop/cmd.Sign({0xc000119600, 0x1, 0x1})
	/home/teythoon/repos/pep/openpgp-interoperability-test-suite/sops/v6/gosop/cmd/sign.go:31 +0x158
github.com/ProtonMail/gosop/cmd.glob..func5(0xc00012a240?)
	/home/teythoon/repos/pep/openpgp-interoperability-test-suite/sops/v6/gosop/cmd/commands.go:65 +0x51
github.com/urfave/cli/v2.(*Command).Run(0x987b40, 0xc0001627c0)
	/home/teythoon/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:164 +0x5dc
github.com/urfave/cli/v2.(*App).RunContext(0xc0001b6000, {0x7b5430?, 0xc000152358}, {0xc00011a150, 0x3, 0x3})
	/home/teythoon/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:306 +0xbfd
github.com/urfave/cli/v2.(*App).Run(...)
	/home/teythoon/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:215
main.main()
	/home/teythoon/repos/pep/openpgp-interoperability-test-suite/sops/v6/gosop/main.go:37 +0x205
@teythoon teythoon changed the title gosop chockes on filenames shorter than 5 characters gosop chokes on filenames shorter than 5 characters Aug 21, 2023
@lubux
Copy link
Contributor

lubux commented Aug 21, 2023

Thanks for the report. Fixed on the gosop-gopenpgp-v3 branch with commit 1359d0ac

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

No branches or pull requests

2 participants