Mercurial > hg > nginx
comparison src/core/ngx_log.c @ 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 | 201d017ea470 |
children | 63dec254cc4a |
comparison
equal
deleted
inserted
replaced
932:1b8111df8051 | 933:1ce231663322 |
---|---|
90 ngx_memcpy(errstr, ngx_cached_err_log_time.data, | 90 ngx_memcpy(errstr, ngx_cached_err_log_time.data, |
91 ngx_cached_err_log_time.len); | 91 ngx_cached_err_log_time.len); |
92 | 92 |
93 p = errstr + ngx_cached_err_log_time.len; | 93 p = errstr + ngx_cached_err_log_time.len; |
94 | 94 |
95 p = ngx_sprintf(p, " [%s] ", err_levels[level]); | 95 p = ngx_snprintf(p, last - p, " [%s] ", err_levels[level]); |
96 | 96 |
97 /* pid#tid */ | 97 /* pid#tid */ |
98 p = ngx_sprintf(p, "%P#" NGX_TID_T_FMT ": ", ngx_log_pid, ngx_log_tid); | 98 p = ngx_snprintf(p, last - p, "%P#" NGX_TID_T_FMT ": ", |
99 ngx_log_pid, ngx_log_tid); | |
99 | 100 |
100 if (log->connection) { | 101 if (log->connection) { |
101 p = ngx_sprintf(p, "*%uA ", log->connection); | 102 p = ngx_snprintf(p, last - p, "*%uA ", log->connection); |
102 } | 103 } |
103 | 104 |
104 #if (NGX_HAVE_VARIADIC_MACROS) | 105 #if (NGX_HAVE_VARIADIC_MACROS) |
105 | 106 |
106 va_start(args, fmt); | 107 va_start(args, fmt); |