From 22fbff523f1893af6b15523e6776e1463b2edf14 Mon Sep 17 00:00:00 2001 From: claudio Date: Mon, 27 Aug 2018 19:32:37 +0000 Subject: [PATCH] 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. --- usr.sbin/bgpd/parse.y | 4 ++-- 1 file 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 @@ -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); -- 2.20.1