# HG changeset patch # User Maxim Dounin # Date 1380564613 -14400 # Node ID 3ff1e663fa0897c18dd26bf3e5090bdf31602153 # Parent 66db21c0ac5526ec239921aac9df3d92e33f1b5f 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 --- 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, mode = ""; } + if (conf->file == NULL) { + conf->file = prev->file; + conf->line = prev->line; + } + if (*mode) { if (conf->certificate.len == 0) {