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
{{ message }}
Repository navigation
Local commands without required arguments cause runtime panic #263
Executing a local Console command without its required argument causes NebulaGraph Console to panic and exit instead of displaying an argument validation error.
For example, entering :repeat in the interactive Console results in a runtime panic.
NebulaGraph Server: Not required (the issue occurs during local command parsing)
OS/Architecture: Not specified
How To Reproduce(required)
Start NebulaGraph Console and connect to a server.
Enter the following local command without an argument:
:repeat
Actual behavior
Console exits with a runtime panic:
panic: runtime error: index out of range [1] with length 1
goroutine 1 [running]:
main.isConsoleCmd(...)
/usr1/nebula_console/main.go:216
main.loop(...)
/usr1/nebula_console/main.go:345
main.main(...)
/usr1/nebula_console/main.go:652
In isConsoleCmd(), the command is split into words, but the repeat case accesses words[1] without checking whether the argument exists.
The same unchecked access is present in the handlers for :sleep, :play, :csv, :dot, :profile, and :explain.
Entering only : can also cause an out-of-range access at words[0].
Expected behavior
Validate that required arguments are present before accessing command arguments.
Display a clear error message when an argument is missing.
Keep the interactive Console running so that the user can enter the next command.
Preserve the existing behavior of valid local commands.
Additional context
Issue #162 was closed as fixed by PR #236. However, PR #236 updates startup flag validation and replaces several log.Panicf() calls; it does not add argument-count checks to the interactive local command parser in isConsoleCmd().
This issue tracks the remaining local-command argument validation gap.
Activity