From 0d6b2ee249e9efba30da3236c413bf03c7b27ed9 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Thu, 29 May 2008 18:29:16 +0000 Subject: [daemons] Sanity check port number arguments before use 2008-05-29 Martin Nagy * */*main.c: Sanity check port numbers before using. --- ospfd/ospf_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ospfd') diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c index 27a12dd0..1a200a8f 100644 --- a/ospfd/ospf_main.c +++ b/ospfd/ospf_main.c @@ -245,7 +245,8 @@ main (int argc, char **argv) break; } vty_port = atoi (optarg); - vty_port = (vty_port ? vty_port : OSPF_VTY_PORT); + if (vty_port <= 0 || vty_port > 0xffff) + vty_port = OSPF_VTY_PORT; break; case 'u': ospfd_privs.user = optarg; -- cgit v1.2.1