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.
diff --git a/src/mail/ngx_mail_ssl_module.c b/src/mail/ngx_mail_ssl_module.c
index 66aa18c..18fd66a 100644
--- a/src/mail/ngx_mail_ssl_module.c
+++ b/src/mail/ngx_mail_ssl_module.c
@@ -235,6 +235,11 @@
mode = "";
}
+ if (conf->file == NULL) {
+ conf->file = prev->file;
+ conf->line = prev->line;
+ }
+
if (*mode) {
if (conf->certificate.len == 0) {