diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2015-01-03 23:54:26 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2015-01-03 23:54:26 +0000 |
commit | 2be6d1fb844af5c9d8d363345b167dba0ed499a3 (patch) | |
tree | 236a88a29c21189d557dcd34bbc19ca071fd328e /usr.sbin/httpd/parse.y | |
parent | ab361e6263b7c567af98d9b52b1a5f99d7c77e20 (diff) |
Reset tls key and cert to NULL when duplicating a server - avoids a
possible double free in the error path of the parser.
Found by + OK doug@
Diffstat (limited to 'usr.sbin/httpd/parse.y')
-rw-r--r-- | usr.sbin/httpd/parse.y | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/httpd/parse.y b/usr.sbin/httpd/parse.y index 860c2ae7c3a..e8f9b1016d2 100644 --- a/usr.sbin/httpd/parse.y +++ b/usr.sbin/httpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.48 2015/01/03 16:20:31 reyk Exp $ */ +/* $OpenBSD: parse.y,v 1.49 2015/01/03 23:54:25 reyk Exp $ */ /* * Copyright (c) 2007 - 2014 Reyk Floeter <reyk@openbsd.org> @@ -1740,6 +1740,8 @@ server_inherit(struct server *src, const char *name, if ((dst->srv_conf.tls_key_file = strdup(src->srv_conf.tls_key_file)) == NULL) fatal("out of memory"); + dst->srv_conf.tls_cert = NULL; + dst->srv_conf.tls_key = NULL; dst->srv_conf.id = ++last_server_id; if (last_server_id == INT_MAX) { |