Welcome! Log In Create A New Profile

Advanced

[njs] Fetch: fixed Headers() constructor.

Dmitry Volyntsev
March 10, 2023 05:18PM
details: https://hg.nginx.org/njs/rev/95f57822bdaa
branches:
changeset: 2072:95f57822bdaa
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Fri Mar 10 14:15:29 2023 -0800
description:
Fetch: fixed Headers() constructor.

Previously, the 'guard' field of ngx_js_headers_t structure was uninitialized,
that caused spurious exception "Error: cannot append to immutable object".

This issue was introduced on 0.7.10.

diffstat:

nginx/ngx_js_fetch.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff -r acacd5d3a276 -r 95f57822bdaa nginx/ngx_js_fetch.c
--- a/nginx/ngx_js_fetch.c Fri Mar 10 13:28:21 2023 -0800
+++ b/nginx/ngx_js_fetch.c Fri Mar 10 14:15:29 2023 -0800
@@ -860,6 +860,8 @@ ngx_js_ext_headers_constructor(njs_vm_t
return NJS_ERROR;
}

+ headers->guard = GUARD_NONE;
+
rc = ngx_list_init(&headers->header_list, pool, 4, sizeof(ngx_js_tb_elt_t));
if (rc != NGX_OK) {
njs_vm_memory_error(vm);
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Fetch: fixed Headers() constructor.

Dmitry Volyntsev 473 March 10, 2023 05:18PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 294
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready