summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2018-08-27 19:32:37 +0000
committerclaudio <claudio@openbsd.org>2018-08-27 19:32:37 +0000
commit22fbff523f1893af6b15523e6776e1463b2edf14 (patch)
tree7a1f66f5d46a791c43992e9541b98dc0f9e353b0
parentn2s and l2n3 finally bite the dust! (diff)
downloadwireguard-openbsd-22fbff523f1893af6b15523e6776e1463b2edf14.tar.xz
wireguard-openbsd-22fbff523f1893af6b15523e6776e1463b2edf14.zip
If the maximum for a community is defined via the large flag then
this maximum should also be passed to strtonum() instead of UINT_MAX or the error handling does not work.
-rw-r--r--usr.sbin/bgpd/parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 7019d4502e9..f9cc9c5ef1c 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.330 2018/08/27 09:49:00 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.331 2018/08/27 19:32:37 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -3191,7 +3191,7 @@ getcommunity(char *s, int large)
return (COMMUNITY_LOCAL_AS);
if (large)
max = UINT_MAX;
- val = strtonum(s, 0, UINT_MAX, &errstr);
+ val = strtonum(s, 0, max, &errstr);
if (errstr) {
yyerror("Community %s is %s (max: %llu)", s, errstr, max);
return (COMMUNITY_ERROR);