commit | 0d6b2ee249e9efba30da3236c413bf03c7b27ed9 | [log] [tgz] |
---|---|---|
author | Paul Jakma <paul.jakma@sun.com> | Thu May 29 18:29:16 2008 +0000 |
committer | Paul Jakma <paul.jakma@sun.com> | Thu May 29 18:29:16 2008 +0000 |
tree | 4d9320f2c34f0c127b58b92f59e2c2afd2d5818f | |
parent | 768a27ea7ba25257c79689af83ab37945dc1cc3c [diff] |
[daemons] Sanity check port number arguments before use 2008-05-29 Martin Nagy <mnagy@redhat.com> * */*main.c: Sanity check port numbers before using.
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c index 27a12dd..1a200a8 100644 --- a/ospfd/ospf_main.c +++ b/ospfd/ospf_main.c
@@ -245,7 +245,8 @@ 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;