summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-04-01 04:51:16 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-04-01 04:51:16 +0000
commit3f9d60dde01f1f8d65039cd3d3909cabcbe293e4 (patch)
tree2fcd5c259b01e18410e6293810f06ef0eaf01113 /usr.sbin
parentb768482fcd14c581d235d8130074ce7a9fe87fb9 (diff)
Zero the tls cert/key length variables when inheriting a server
configuration for multiple listen statements in a server block. Otherwise httpd will crash when a listen statement with tls is followed by a listen statement without tls. Problem reported by Kent Fritz on misc. ok jsing@ looks good deraadt@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/httpd/parse.y4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/httpd/parse.y b/usr.sbin/httpd/parse.y
index 50e51ab6354..0aae42164d2 100644
--- a/usr.sbin/httpd/parse.y
+++ b/usr.sbin/httpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.66 2015/03/09 15:46:45 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.67 2015/04/01 04:51:15 jsg Exp $ */
/*
* Copyright (c) 2007 - 2015 Reyk Floeter <reyk@openbsd.org>
@@ -1907,6 +1907,8 @@ server_inherit(struct server *src, const char *name,
fatal("out of memory");
dst->srv_conf.tls_cert = NULL;
dst->srv_conf.tls_key = NULL;
+ dst->srv_conf.tls_cert_len = 0;
+ dst->srv_conf.tls_key_len = 0;
if (src->srv_conf.return_uri != NULL &&
(dst->srv_conf.return_uri =