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

In case of inproper argument passing, the tool will panic #231

Open
filipecosta90 opened this issue Jul 12, 2022 · 0 comments
Open

In case of inproper argument passing, the tool will panic #231

filipecosta90 opened this issue Jul 12, 2022 · 0 comments

Comments

@filipecosta90
Copy link
Contributor

Given on line 94, there is no check for the slice length:

globalProps.Set(seps[0], seps[1])

in case of improper argument passing:

Example:

./bin/go-ycsb load redis  -p recordcount=10000 -p threadcount 4

the tool will panic:

$ ./bin/go-ycsb load redis  -p recordcount=10000 -p threadcount 4
panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
main.initialGlobal({0x7ffe6908663f, 0x5}, 0xc0007bfb00)
        /home/fco/redislabs/go-ycsb/cmd/go-ycsb/main.go:94 +0x61b
main.runClientCommandFunc(0x795ee0?, {0xc0005e82a0?, 0xc0007bfcd0?, 0x0?}, 0x0?)
        /home/fco/redislabs/go-ycsb/cmd/go-ycsb/client.go:30 +0x90
main.runLoadCommandFunc(0xc000579b80?, {0xc0005e82a0?, 0x6?, 0x6?})
        /home/fco/redislabs/go-ycsb/cmd/go-ycsb/client.go:66 +0x25
github.com/spf13/cobra.(*Command).execute(0xc000579b80, {0xc0005e8240, 0x6, 0x6})
        /home/fco/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0xc000579340)
        /home/fco/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x39c
github.com/spf13/cobra.(*Command).Execute(...)
        /home/fco/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
main.main()
        /home/fco/redislabs/go-ycsb/cmd/go-ycsb/main.go:172 +0x22c
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

1 participant