make sure there is room for null terminator

This commit is contained in:
iceman1001 2021-04-19 23:25:13 +02:00
commit bb9cf8ec40

View file

@ -657,7 +657,7 @@ int CmdTraceListAlias(const char *Cmd, const char *alias, const char *protocol)
CLIExecWithReturn(ctx, Cmd, argtable, true);
char args[128] = {0};
snprintf(args, sizeof(args), "-t %s ", protocol);
strncat(args, Cmd, sizeof(args) - strlen(args));
strncat(args, Cmd, sizeof(args) - strlen(args) - 1);
return CmdTraceList(args);
}