You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the following. I ran vmmetadataexporter without host, username, password
ericwb@ubuntu-24:~/workspace/vjailbreak/vm_metadata_export$ ./vmmetadataexporter
panic: runtime error: slice bounds out of range [:4] with length 0
goroutine 1 [running]:
main.validateVCenter({0x0?, 0xc000096040?}, {0x0?, 0x0?}, {0x0?, 0xb95141?}, 0xc?)
/home/ericwb/workspace/vjailbreak/vm_metadata_export/main.go:31 +0x1f2
main.main()
/home/ericwb/workspace/vjailbreak/vm_metadata_export/main.go:105 +0x17d
The code sets a default value for host, username, password of "". However, the code then proceeds to do a slice assuming the host contains "https", causing the panic.
If host is required, I recommend showing the usage if not given. Or prompting the user for the information when not given.
The text was updated successfully, but these errors were encountered:
ericwb
added a commit
to ericwb/vjailbreak
that referenced
this issue
Feb 7, 2025
This change does more validation of the CLI args given to
vmmetadataexporter to avoid panics. If host isn't given, it
errors and exits. If username or password isn't given, it
prompts the user to input them.
This handles a variety of scenarios around giving or not giving
these three arguments. It is also a better solution around
handling a password, since a CLI password arg gets leaked to
the shell history and potentially other logs.
Fixesplatform9#165
Signed-off-by: Eric Brown <[email protected]>
See the following. I ran vmmetadataexporter without host, username, password
The code sets a default value for host, username, password of "". However, the code then proceeds to do a slice assuming the host contains "https", causing the panic.
If host is required, I recommend showing the usage if not given. Or prompting the user for the information when not given.
The text was updated successfully, but these errors were encountered: