Prevent crash for HTTP/0.9 requests (fix #22).
(cherry picked from commit 958a4b6962)
This commit is contained in:
parent
ae5dbab56c
commit
8f0857d3f9
1 changed files with 7 additions and 1 deletions
|
|
@ -242,7 +242,13 @@ ngx_int_t setHeader(ngx_http_request_t* r, StrView name, StrView value)
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
header = (ngx_table_elt_t*)ngx_list_push(&r->headers_in.headers);
|
auto headers = &r->headers_in.headers;
|
||||||
|
if (!headers->pool && ngx_list_init(headers, r->pool, 2,
|
||||||
|
sizeof(ngx_table_elt_t)) != NGX_OK) {
|
||||||
|
return NGX_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
header = (ngx_table_elt_t*)ngx_list_push(headers);
|
||||||
if (header == NULL) {
|
if (header == NULL) {
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue