mirror of
https://git.proxmox.com/git/mirror_frr
synced 2026-02-01 18:56:52 +00:00
lib: uninitialized variable (2) (Coverity 1469898)
Previous correction (2c2d5cb397) was not enough,
so now it is ensured that the argument shift is not negative nor zero.
Signed-off-by: F. Aragon <paco@voltanet.io>
This commit is contained in:
parent
2c2d5cb397
commit
a6a87d63d0
@ -261,8 +261,11 @@ void print_version(const char *progname)
|
||||
|
||||
char *argv_concat(struct cmd_token **argv, int argc, int shift)
|
||||
{
|
||||
int cnt = argc - shift;
|
||||
const char *argstr[cnt];
|
||||
int cnt = MAX(argc - shift, 0);
|
||||
const char *argstr[cnt + 1];
|
||||
|
||||
if (!cnt)
|
||||
return NULL;
|
||||
|
||||
for (int i = 0; i < cnt; i++)
|
||||
argstr[i] = argv[i + shift]->arg;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user