SSL: handled long string truncation in ngx_ssl_error().

If no space left in buffer after adding formatting symbols, error message
could be left without terminating null.  The fix is to output message using
actual length.
This commit is contained in:
Vladimir Homutov 2015-10-07 22:19:42 +03:00
parent 3aaef64d3d
commit 962f253d1b

View file

@ -2045,7 +2045,7 @@ ngx_ssl_error(ngx_uint_t level, ngx_log_t *log, ngx_err_t err, char *fmt, ...)
(void) ERR_get_error();
}
ngx_log_error(level, log, err, "%s)", errstr);
ngx_log_error(level, log, err, "%*s)", p - errstr, errstr);
}