aws / aws/session-manager-plugin
panic/segfault if sessionId is omitted
- Dominant language
- Go
- Stars
- 320
- Forks
- 97
- PR merge metrics
- No merged PRs in 30d
Description
Invoking `session-manager-plugin` without "sessionId" causes a panic.
```
session-manager-plugin "{\"streamUrl\":\"wss://ssmmessages.us-west-2.amazonaws.com/v1/data-channel/123\",\"tokenValue\":\"abc\"}" "us-east-1" "StartSession"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x151bb35]
goroutine 1 [running]:
github.com/aws/SSMCLI/src/sessionmanagerplugin/session.ValidateInputAndStartSession(0xc00001e080, 0x4, 0x4, 0x1772260, 0xc00000e018)
/local/p4clients/pkgbuild-_Kjh0/workspace/src/SSMCLI/build/private/src/github.com/aws/SSMCLI/src/sessionmanagerplugin/session/session.go:171 +0x5d5
main.main()
/local/p4clients/pkgbuild-_Kjh0/workspace/src/SSMCLI/src/sessionmanagerplugin-main/main.go:26 +0x5d
```
Same behavior with an empty JSON string:
```
session-manager-plugin "{}" "us-east-1" "StartSession"
```
Contributor guide
Assessment
This issue has not been assessed yet.