summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2019-05-03 15:08:48 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2019-05-03 15:08:48 +0000
commitabbf0cb9c2554eaf001d3d4945f1023214ee17d1 (patch)
treeeaa4f811bc26883df6b5601f42286d396f4e934e /usr.sbin
parent84b75664bf7de059ab90a55b3763de2330c7f176 (diff)
Make sure that the as-set name is not too long when parsing the config file.
Fixes an assertion caught in new_as_set() parsing some arouteserver config.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/parse.y7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index feb22478ccb..3447519cd0c 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.386 2019/04/10 15:21:54 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.387 2019/05/03 15:08:47 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -404,6 +404,11 @@ include : INCLUDE STRING {
;
as_set : ASSET STRING '{' optnl {
+ if (strlen($2) >= SET_NAME_LEN) {
+ yyerror("as-set name %s too long", $2);
+ free($2);
+ YYERROR;
+ }
if (new_as_set($2) != 0) {
free($2);
YYERROR;