summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bgpd/parse.y')
-rw-r--r--usr.sbin/bgpd/parse.y11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index d2c027faa69..c0665585770 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.43 2004/01/28 23:31:28 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.44 2004/01/28 23:49:55 henning Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -344,8 +344,13 @@ peeropts : REMOTEAS number {
curpeer->conf.max_prefix = $2;
}
| TCP MD5SIG PASSWORD string {
- strlcpy(curpeer->conf.tcp_md5_key, $4,
- sizeof(curpeer->conf.tcp_md5_key));
+ if (strlcpy(curpeer->conf.tcp_md5_key, $4,
+ sizeof(curpeer->conf.tcp_md5_key)) >=
+ sizeof(curpeer->conf.tcp_md5_key)) {
+ yyerror("tcp md5sig password too long: max %u",
+ sizeof(curpeer->conf.tcp_md5_key) - 1);
+ YYERROR;
+ }
}
| TCP MD5SIG KEY string {
unsigned i;