Mercurial > hg > nginx
changeset 933:1ce231663322
ngx_sprintf() has implicit limit of 65536 bytes so on Linux/ppc64
in 32-bit mode the errstr is somewhere at 0xffffd680, the "last" overflows
and ngx_vsnprintf() does not print at all
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 19 Dec 2006 12:40:19 +0000 |
parents | 1b8111df8051 |
children | 4745e72044fb |
files | src/core/ngx_log.c |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/core/ngx_log.c Tue Dec 19 12:38:20 2006 +0000 +++ b/src/core/ngx_log.c Tue Dec 19 12:40:19 2006 +0000 @@ -92,13 +92,14 @@ p = errstr + ngx_cached_err_log_time.len; - p = ngx_sprintf(p, " [%s] ", err_levels[level]); + p = ngx_snprintf(p, last - p, " [%s] ", err_levels[level]); /* pid#tid */ - p = ngx_sprintf(p, "%P#" NGX_TID_T_FMT ": ", ngx_log_pid, ngx_log_tid); + p = ngx_snprintf(p, last - p, "%P#" NGX_TID_T_FMT ": ", + ngx_log_pid, ngx_log_tid); if (log->connection) { - p = ngx_sprintf(p, "*%uA ", log->connection); + p = ngx_snprintf(p, last - p, "*%uA ", log->connection); } #if (NGX_HAVE_VARIADIC_MACROS)