summaryrefslogtreecommitdiff
path: root/ripngd/ripng_main.c
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2008-05-29 18:29:16 +0000
committerPaul Jakma <paul.jakma@sun.com>2008-05-29 18:29:16 +0000
commit0d6b2ee249e9efba30da3236c413bf03c7b27ed9 (patch)
tree4d9320f2c34f0c127b58b92f59e2c2afd2d5818f /ripngd/ripng_main.c
parent768a27ea7ba25257c79689af83ab37945dc1cc3c (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.
Diffstat (limited to 'ripngd/ripng_main.c')
-rw-r--r--ripngd/ripng_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ripngd/ripng_main.c b/ripngd/ripng_main.c
index 70553910..a18ce9de 100644
--- a/ripngd/ripng_main.c
+++ b/ripngd/ripng_main.c
@@ -240,7 +240,8 @@ main (int argc, char **argv)
break;
}
vty_port = atoi (optarg);
- vty_port = (vty_port ? vty_port : RIPNG_VTY_PORT);
+ if (vty_port <= 0 || vty_port > 0xffff)
+ vty_port = RIPNG_VTY_PORT;
break;
case 'r':
retain_mode = 1;