]> git.kaiwu.me - nginx.git/commit
Rewrite: harden escape flags control
authorRoman Arutyunyan <arut@nginx.com>
Thu, 14 May 2026 13:47:42 +0000 (17:47 +0400)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Thu, 21 May 2026 14:00:00 +0000 (18:00 +0400)
commit475732a3f9dfe82fc2ecdb0a7426083c9c1ee965
tree5f3e8ba405ecd832e42005b50e752ce9a94d3c70
parenteff110885412737aec9b953067b6a670bffdbfa0
Rewrite: harden escape flags control

Following 2046b45aa0c6, this change introduces better control of memory
allocation flags for escaped values.  Notably:

- The e->is_args flag is now explicitly reset on rewrite start.
  If the flag was set prior to rewrite start, then buffer overflow
  could happen before 2046b45aa0c6.

- The le->is_args flag value is now copied from e->is_args when
  calculating complex value length for "if" and "set" directives.
  If e->is_args was set, but le->is_args was not, then buffer overflow
  could happen before 2046b45aa0c6.
src/http/ngx_http_script.c