diff options
Diffstat (limited to 'usr.sbin/bgpctl/parser.c')
-rw-r--r-- | usr.sbin/bgpctl/parser.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c index 08059eb10dd..ba4a0f3cead 100644 --- a/usr.sbin/bgpctl/parser.c +++ b/usr.sbin/bgpctl/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.44 2007/04/23 13:05:35 claudio Exp $ */ +/* $OpenBSD: parser.c,v 1.45 2007/05/28 20:09:21 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -645,6 +645,9 @@ parse_asnum(const char *word, u_int32_t *asnum) if (word == NULL) return (0); + if (strlen(word) < 1 || word[0] < '0' || word[0] > '9') + return (0); + if ((dot = strchr(word,'.')) != NULL) { *dot++ = '\0'; uvalh = strtonum(word, 0, USHRT_MAX, &errstr); |