mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 01:47:29 +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;
|
break;
|
||||||
case CMD_ERR_NO_MATCH:
|
case CMD_ERR_NO_MATCH:
|
||||||
cmd_free_strvec(vline);
|
cmd_free_strvec(vline);
|
||||||
vector_free(describe);
|
if (describe)
|
||||||
|
vector_free(describe);
|
||||||
fprintf(stdout, "%% There is no matched command.\n");
|
fprintf(stdout, "%% There is no matched command.\n");
|
||||||
rl_on_new_line();
|
rl_on_new_line();
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user