diff options
author | Igor Sysoev <igor@sysoev.ru> | 2006-12-19 12:40:19 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2006-12-19 12:40:19 +0000 |
commit | 18d6514eb5eaed0c92751cd80b663dea049467b3 (patch) | |
tree | 4a4baf69434dce026655fbf353cb0ead85b0f38a /src | |
parent | f4b34c4754829451b61bbd69d15591ceb154cfcf (diff) | |
download | nginx-18d6514eb5eaed0c92751cd80b663dea049467b3.tar.gz nginx-18d6514eb5eaed0c92751cd80b663dea049467b3.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/core/ngx_log.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c index ea4e7f2f4..175190ce2 100644 --- a/src/core/ngx_log.c +++ b/src/core/ngx_log.c @@ -92,13 +92,14 @@ ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err, 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) |