mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 06:29:40 +00:00
vtysh: fix stack buffer overflow
VARIABLE accepts arbitrary input Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
2dc1ef552b
commit
c25c61370f
@ -2029,17 +2029,19 @@ DEFUNSH (VTYSH_INTERFACE,
|
|||||||
DEFUN (vtysh_show_thread,
|
DEFUN (vtysh_show_thread,
|
||||||
vtysh_show_thread_cmd,
|
vtysh_show_thread_cmd,
|
||||||
"show thread cpu [FILTER]",
|
"show thread cpu [FILTER]",
|
||||||
SHOW_STR
|
SHOW_STR
|
||||||
"Thread information\n"
|
"Thread information\n"
|
||||||
"Thread CPU usage\n"
|
"Thread CPU usage\n"
|
||||||
"Display filter (rwtexb)\n")
|
"Display filter (rwtexb)\n")
|
||||||
{
|
{
|
||||||
int idx_filter = 3;
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
int idx = 0;
|
||||||
int ret = CMD_SUCCESS;
|
int ret = CMD_SUCCESS;
|
||||||
char line[100];
|
char line[100];
|
||||||
|
|
||||||
sprintf(line, "show thread cpu %s\n", (argc == 4) ? argv[idx_filter]->arg : "");
|
const char *filter = argv_find (argv, argc, "FILTER", &idx) ? argv[idx]->arg : "";
|
||||||
|
|
||||||
|
snprintf(line, sizeof(line), "do show thread cpu %s\n", filter);
|
||||||
for (i = 0; i < array_size(vtysh_client); i++)
|
for (i = 0; i < array_size(vtysh_client); i++)
|
||||||
if ( vtysh_client[i].fd >= 0 )
|
if ( vtysh_client[i].fd >= 0 )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user