details: http://hg.nginx.org/nginx/rev/d1f94042c29c branches: changeset: 6223:d1f94042c29c user: Vladimir Homutov <[email protected]> date: Thu Aug 13 15:55:21 2015 +0300 description: Stream: fixed potential error log buffer overrun.
Found by Duan Jiong <[email protected]>. diffstat: src/stream/ngx_stream_handler.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diffs (16 lines): diff -r 1bd5eb20bd7c -r d1f94042c29c src/stream/ngx_stream_handler.c --- a/src/stream/ngx_stream_handler.c Wed Aug 12 12:56:59 2015 +0300 +++ b/src/stream/ngx_stream_handler.c Thu Aug 13 15:55:21 2015 +0300 @@ -328,9 +328,11 @@ ngx_stream_log_error(ngx_log_t *log, u_c p = ngx_snprintf(buf, len, ", client: %V, server: %V", &s->connection->addr_text, &s->connection->listening->addr_text); + len -= p - buf; + buf = p; if (s->log_handler) { - return s->log_handler(log, p, len); + p = s->log_handler(log, buf, len); } return p; _______________________________________________ nginx-devel mailing list [email protected] http://mailman.nginx.org/mailman/listinfo/nginx-devel
