Mercurial > hg > nginx
changeset 7916:29795b697e14
HTTP/2: avoid memcpy() with NULL source and zero length.
Prodded by Clang Static Analyzer.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 31 Aug 2021 16:44:13 +0300 |
parents | 09d15a2dbc6b |
children | f0ab1db646d5 |
files | src/http/v2/ngx_http_v2.c |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/v2/ngx_http_v2.c Mon Aug 30 14:45:21 2021 +0300 +++ b/src/http/v2/ngx_http_v2.c Tue Aug 31 16:44:13 2021 +0300 @@ -4241,7 +4241,9 @@ n = size; } - rb->buf->last = ngx_cpymem(rb->buf->last, pos, n); + if (n > 0) { + rb->buf->last = ngx_cpymem(rb->buf->last, pos, n); + } ngx_log_debug1(NGX_LOG_DEBUG_HTTP, fc->log, 0, "http2 request body recv %uz", n);