mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 20:55:25 +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;
|
||||
|
||||
if (cmd == NULL)
|
||||
return 0;
|
||||
|
||||
return ((p = strchr(cmd, '%')) != NULL) && (*(p + 1) == 's')
|
||||
&& !strchr(p + 1, '%');
|
||||
}
|
||||
@ -1414,7 +1417,7 @@ int main(int argc, char **argv)
|
||||
} break;
|
||||
case OPTION_NETNS:
|
||||
netns_en = true;
|
||||
if (strchr(optarg, '/')) {
|
||||
if (optarg && strchr(optarg, '/')) {
|
||||
fprintf(stderr,
|
||||
"invalid network namespace name \"%s\" (may not contain slashes)\n",
|
||||
optarg);
|
||||
|
Loading…
Reference in New Issue
Block a user