]> git.kaiwu.me - nginx.git/commit
Core: kept JSON escaping within valid UTF-8 dev/escape-json-utf8
authorDmitry Plotnikov <d.plotnikov@f5.com>
Thu, 29 Oct 2026 15:34:07 +0000 (15:34 +0000)
committerDmitry Plotnikov <d.plotnikov@f5.com>
Thu, 29 Oct 2026 16:17:09 +0000 (16:17 +0000)
commitb2f6f09497855698aa4aaaa4c1fcc70a593aa465
treed068f465f5d3a917e4d674eb76f63ebb83a34b6f
parent67290bfea61c81347464539f5e6d0a7cebec1fc8
Core: kept JSON escaping within valid UTF-8

ngx_escape_json() escaped the JSON metacharacters and the control
bytes but copied every byte above 0x7f through unchanged, so a value
carrying malformed UTF-8 produced a quoted string that a strict
consumer rejects.  Such bytes are now replaced with U+FFFD, one per
offending byte.
src/core/ngx_string.c