summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbenno <benno@openbsd.org>2014-01-21 21:38:40 +0000
committerbenno <benno@openbsd.org>2014-01-21 21:38:40 +0000
commitae74277d2859bb4dcf214190616d835087f91cf2 (patch)
tree94b0471d280ac07a5ad3a3ef9312f0ee2a5ec1ac
parentallow pflow(4) to determine the src IP address based on the route (diff)
downloadwireguard-openbsd-ae74277d2859bb4dcf214190616d835087f91cf2.tar.xz
wireguard-openbsd-ae74277d2859bb4dcf214190616d835087f91cf2.zip
fix a a double free caused by a config with two listen on statements
in a relay (the first one with ssl). found and fixed by Erik Lax <erik AT halon DOT se> ok phessler
-rw-r--r--usr.sbin/relayd/parse.y8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/relayd/parse.y b/usr.sbin/relayd/parse.y
index 76409a3dfb0..a252074e13d 100644
--- a/usr.sbin/relayd/parse.y
+++ b/usr.sbin/relayd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.173 2013/11/25 13:00:07 benno Exp $ */
+/* $OpenBSD: parse.y,v 1.174 2014/01/21 21:38:40 benno Exp $ */
/*
* Copyright (c) 2007-2011 Reyk Floeter <reyk@openbsd.org>
@@ -2809,6 +2809,12 @@ relay_inherit(struct relay *ra, struct relay *rb)
rb->rl_conf.port = rc.port;
rb->rl_conf.flags =
(ra->rl_conf.flags & ~F_SSL) | (rc.flags & F_SSL);
+ if (!(rb->rl_conf.flags & F_SSL)) {
+ rb->rl_ssl_cert = NULL;
+ rb->rl_conf.ssl_cert_len = 0;
+ rb->rl_ssl_key = NULL;
+ rb->rl_conf.ssl_key_len = 0;
+ }
TAILQ_INIT(&rb->rl_tables);
rb->rl_conf.id = ++last_relay_id;