From ef8c64acbe7b826b2bbd2dacc0e173cf79b26d37 Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Mon, 30 Sep 2013 22:10:13 +0400 Subject: [PATCH] Mail: fixed segfault with ssl/starttls at mail{} level and no cert. A configuration like "mail { starttls on; server {}}" triggered NULL pointer dereference in ngx_mail_ssl_merge_conf() as conf->file was not set. --- src/mail/ngx_mail_ssl_module.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mail/ngx_mail_ssl_module.c b/src/mail/ngx_mail_ssl_module.c index 66aa18c3b..18fd66aed 100644 --- a/src/mail/ngx_mail_ssl_module.c +++ b/src/mail/ngx_mail_ssl_module.c @@ -235,6 +235,11 @@ ngx_mail_ssl_merge_conf(ngx_conf_t *cf, void *parent, void *child) mode = ""; } + if (conf->file == NULL) { + conf->file = prev->file; + conf->line = prev->line; + } + if (*mode) { if (conf->certificate.len == 0) {