diff options
author | Roman Arutyunyan <arut@nginx.com> | 2020-03-14 13:18:55 +0300 |
---|---|---|
committer | Roman Arutyunyan <arut@nginx.com> | 2020-03-14 13:18:55 +0300 |
commit | 5399670fcc51b440f00a9a584654f7bcc52d3f88 (patch) | |
tree | 38e16402892ab5ad74230f1a4c58a4c207fae98d /src/http/v3/ngx_http_v3_request.c | |
parent | 1ac31c01b4a2df79a512a7b6bde67002b3e5259e (diff) | |
download | nginx-5399670fcc51b440f00a9a584654f7bcc52d3f88.tar.gz nginx-5399670fcc51b440f00a9a584654f7bcc52d3f88.zip |
Temporary fix for header null-termination in HTTP/3.
Diffstat (limited to 'src/http/v3/ngx_http_v3_request.c')
-rw-r--r-- | src/http/v3/ngx_http_v3_request.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/http/v3/ngx_http_v3_request.c b/src/http/v3/ngx_http_v3_request.c index b34eed98e..9cb351c2d 100644 --- a/src/http/v3/ngx_http_v3_request.c +++ b/src/http/v3/ngx_http_v3_request.c @@ -518,6 +518,18 @@ done: } } + /* XXX ugly reallocation for the trailing '\0' */ + + p = ngx_pnalloc(c->pool, name.len + value.len + 2); + if (p == NULL) { + return NGX_ERROR; + } + + ngx_memcpy(p, name.data, name.len); + name.data = p; + ngx_memcpy(p + name.len + 1, value.data, value.len); + value.data = p + name.len + 1; + ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 header \"%V\":\"%V\"", &name, &value); |