mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 07:37:29 +00:00
Merge pull request #7925 from opensourcerouting/watchfrr-netns
watchfrr: fix crash on missing optional argument
This commit is contained in:
commit
b2fd215b21
@ -1080,6 +1080,9 @@ static int valid_command(const char *cmd)
|
|||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
|
if (cmd == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
return ((p = strchr(cmd, '%')) != NULL) && (*(p + 1) == 's')
|
return ((p = strchr(cmd, '%')) != NULL) && (*(p + 1) == 's')
|
||||||
&& !strchr(p + 1, '%');
|
&& !strchr(p + 1, '%');
|
||||||
}
|
}
|
||||||
@ -1414,7 +1417,7 @@ int main(int argc, char **argv)
|
|||||||
} break;
|
} break;
|
||||||
case OPTION_NETNS:
|
case OPTION_NETNS:
|
||||||
netns_en = true;
|
netns_en = true;
|
||||||
if (strchr(optarg, '/')) {
|
if (optarg && strchr(optarg, '/')) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"invalid network namespace name \"%s\" (may not contain slashes)\n",
|
"invalid network namespace name \"%s\" (may not contain slashes)\n",
|
||||||
optarg);
|
optarg);
|
||||||
|
Loading…
Reference in New Issue
Block a user