summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2014-01-21 21:38:41 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2014-01-21 21:38:41 +0000
commit8ef3c99976ca044dd12bd7886ff39b8e625e19b6 (patch)
tree48193fdd058ceacbee0225adf8d0ba2bea3b464b /usr.sbin/relayd
parentbbf957cc5adb91037b33e37b595a467847061996 (diff)
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
Diffstat (limited to 'usr.sbin/relayd')
-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;