]> git.kaiwu.me - njs.git/commit
Fetch: fix empty response status text handling
authorDmitry Volyntsev <xeioex@nginx.com>
Wed, 19 Aug 2026 19:50:59 +0000 (12:50 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Thu, 20 Aug 2026 18:32:21 +0000 (11:32 -0700)
commita62feb4831e75c75c446298ca4a23862dcfcbab4
tree0456367cb370b1dcf10876e953f7ad303b8644a5
parent1308b320821aa209a7985cc8f52c09a515130ba6
Fetch: fix empty response status text handling

A status line with an empty reason phrase terminated by a bare LF left
the status text start unset.  The resulting invalid string slice crashed
the worker when JavaScript read Response.statusText.

Initialize both ends of an empty status text before returning from the
parser.  This also avoids subtracting NULL pointers for status lines
without a reason phrase.
nginx/ngx_js_http.c
nginx/t/js_fetch.t