mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 09:00:55 +00:00
vtysh: protect null deref for cli completions
cmd_describe_command() returns NULL when there is no matched command, so check the return value before trying to free it Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
e919cf55bd
commit
9320658c0d
@ -820,7 +820,8 @@ static int vtysh_rl_describe(void)
|
||||
break;
|
||||
case CMD_ERR_NO_MATCH:
|
||||
cmd_free_strvec(vline);
|
||||
vector_free(describe);
|
||||
if (describe)
|
||||
vector_free(describe);
|
||||
fprintf(stdout, "%% There is no matched command.\n");
|
||||
rl_on_new_line();
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user