commit | affce9b135bbc7d315806b18c52ade96206f7431 | [log] [tgz] |
---|---|---|
author | Maxim Dounin <mdounin@mdounin.ru> | Tue Aug 31 16:44:13 2021 +0300 |
committer | Maxim Dounin <mdounin@mdounin.ru> | Tue Aug 31 16:44:13 2021 +0300 |
tree | 3bbe770f6d3ba5b65d71b27a7efed6e569ace5d9 | |
parent | 4084d48226f1bdcd6c1dc59b338244c7c84f9dd3 [diff] |
HTTP/2: avoid memcpy() with NULL source and zero length. Prodded by Clang Static Analyzer.
diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c index 5ccb363..79c4f17 100644 --- a/src/http/v2/ngx_http_v2.c +++ b/src/http/v2/ngx_http_v2.c
@@ -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);