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

[BUG] govc host.esxcli crashes when no arguments are specified #2960

Closed
Syuparn opened this issue Oct 2, 2022 · 0 comments · Fixed by #2961
Closed

[BUG] govc host.esxcli crashes when no arguments are specified #2960

Syuparn opened this issue Oct 2, 2022 · 0 comments · Fixed by #2961

Comments

@Syuparn
Copy link
Contributor

Syuparn commented Oct 2, 2022

Describe the bug
When govc host.esxcli is executed without any arguments, govc crashes by runtime error.

To Reproduce
Steps to reproduce the behavior:

  1. run command below to a vCenter
govc host.esxcli

Expected behavior
host.esxcli succeeds without any output (or return validation error that tells no arguments are specified).

Affected version

  • govc 0.29.0

Screenshots/Debug Output
govc crashes by slice bounds out of range.

$ govc host.esxcli
panic: runtime error: slice bounds out of range [:-1]

goroutine 1 [running]:
github.com/vmware/govmomi/govc/host/esxcli.(*Command).Namespace(...)
        /home/runner/work/govmomi/govmomi/govc/host/esxcli/command.go:79
github.com/vmware/govmomi/govc/host/esxcli.(*Executor).CommandInfo(0x19b2bc0?, 0xc0000050c8?)
        /home/runner/work/govmomi/govmomi/govc/host/esxcli/executor.go:76 +0x4d5
github.com/vmware/govmomi/govc/host/esxcli.(*Executor).NewRequest(0x9?, {0xc0001163b0?, 0x27?, 0xc000166840?})
        /home/runner/work/govmomi/govmomi/govc/host/esxcli/executor.go:110 +0x88
github.com/vmware/govmomi/govc/host/esxcli.(*Executor).Run(0xc000166840?, {0xc0001163b0?, 0x19bda98?, 0xc00011e090?})
        /home/runner/work/govmomi/govmomi/govc/host/esxcli/executor.go:153 +0x27
github.com/vmware/govmomi/govc/host/esxcli.(*esxcli).Run(0xc000108e30, {0x19bda98?, 0xc00011e090?}, 0xc000156360)
        /home/runner/work/govmomi/govmomi/govc/host/esxcli/esxcli.go:89 +0x85
github.com/vmware/govmomi/govc/cli.Run({0xc0001163b0, 0x1, 0x1})
        /home/runner/work/govmomi/govmomi/govc/cli/command.go:165 +0x32d
main.main()
        /home/runner/work/govmomi/govmomi/govc/main.go:114 +0x4f
Syuparn added a commit to Syuparn/govmomi that referenced this issue Oct 2, 2022
Closes: vmware#2960
Signed-off-by: syuparn <s.hello.spagetti@gmail.com>
Syuparn added a commit to Syuparn/govmomi that referenced this issue Oct 4, 2022
Closes: vmware#2960
Signed-off-by: syuparn <s.hello.spagetti@gmail.com>
priyanka19-98 pushed a commit to priyanka19-98/govmomi that referenced this issue Jan 17, 2024
Closes: vmware#2960
Signed-off-by: syuparn <s.hello.spagetti@gmail.com>
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 a pull request may close this issue.

1 participant