mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
Temporary fix for header null-termination in HTTP/3.
This commit is contained in:
parent
1ac31c01b4
commit
5399670fcc
@ -1547,11 +1547,11 @@ ngx_http_process_request_headers(ngx_event_t *rev)
|
||||
|
||||
h->key.len = r->header_name_end - r->header_name_start;
|
||||
h->key.data = r->header_name_start;
|
||||
//h->key.data[h->key.len] = '\0';
|
||||
h->key.data[h->key.len] = '\0';
|
||||
|
||||
h->value.len = r->header_end - r->header_start;
|
||||
h->value.data = r->header_start;
|
||||
//h->value.data[h->value.len] = '\0';
|
||||
h->value.data[h->value.len] = '\0';
|
||||
|
||||
h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
|
||||
if (h->lowcase_key == NULL) {
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user