summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-01-16 00:45:09 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-01-16 00:45:09 +0100
commiteffe821e25bed4da2499a3b19deff3a61973988f (patch)
tree53ded2cef4861e6ebd32b78ff5a48cd3da10bfdc
parentbgpd: Fixup optional safi parameters (diff)
downloadfrr-effe821e25bed4da2499a3b19deff3a61973988f.tar.xz
frr-effe821e25bed4da2499a3b19deff3a61973988f.zip
ospfd: Fix some more virtual-link crashes
This commit fixes 2 virtual link cli crashes. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--ospfd/ospf_vty.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index fb24e0572..874294ded 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -1104,15 +1104,22 @@ DEFUN (ospf_area_vlink,
case 'm':
/* message-digest-key */
i++;
- vl_config.crypto_key_id = strtol (argv[i]->arg, NULL, 10);
- if (vl_config.crypto_key_id < 0)
- return CMD_WARNING;
- i++;
- memset(md5_key, 0, OSPF_AUTH_MD5_SIZE+1);
- strncpy (md5_key, argv[i]->arg, OSPF_AUTH_MD5_SIZE);
- vl_config.md5_key = md5_key;
+ if (i < argc)
+ {
+ vl_config.crypto_key_id = strtol (argv[i]->arg, NULL, 10);
+ if (vl_config.crypto_key_id < 0)
+ return CMD_WARNING;
+ i++;
+ if (i < argc)
+ {
+ memset(md5_key, 0, OSPF_AUTH_MD5_SIZE+1);
+ strncpy (md5_key, argv[i]->arg, OSPF_AUTH_MD5_SIZE);
+ vl_config.md5_key = md5_key;
+ }
+ }
+ else
+ vl_config.md5_key = NULL;
break;
-
}
}
@@ -1238,7 +1245,7 @@ DEFUN (no_ospf_area_vlink,
/* If we are down here, we are reseting parameters */
/* Deal with other parameters */
- for (i=6; argc; i++)
+ for (i=6; i < argc; i++)
{
/* vty_out (vty, "argv[%d] - %s%s", i, argv[i], VTY_NEWLINE); */