mirror of
https://github.com/nginx/nginx.git
synced 2024-12-02 11:49:01 +08:00
Stream: fixed potential error log buffer overrun.
Found by Duan Jiong <djduanjiong@gmail.com>.
This commit is contained in:
parent
75dcdc2269
commit
f2d31f8291
@ -328,9 +328,11 @@ ngx_stream_log_error(ngx_log_t *log, u_char *buf, size_t len)
|
|||||||
p = ngx_snprintf(buf, len, ", client: %V, server: %V",
|
p = ngx_snprintf(buf, len, ", client: %V, server: %V",
|
||||||
&s->connection->addr_text,
|
&s->connection->addr_text,
|
||||||
&s->connection->listening->addr_text);
|
&s->connection->listening->addr_text);
|
||||||
|
len -= p - buf;
|
||||||
|
buf = p;
|
||||||
|
|
||||||
if (s->log_handler) {
|
if (s->log_handler) {
|
||||||
return s->log_handler(log, p, len);
|
p = s->log_handler(log, buf, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
|
Loading…
Reference in New Issue
Block a user