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.
This commit is contained in:
Maxim Dounin 2013-09-30 22:10:13 +04:00
parent aa36cc39a4
commit ef8c64acbe

View File

@ -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) {