patch 9.1.1802: 'nowrap' in a modeline may hide malicious code

Problem:  'nowrap' in a modeline may hide malicious code.
Solution: Forcibly use '>' as 'listchars' "extends" if 'nowrap' was set
          from a modeline (zeertzjq).

Manual `:setlocal nowrap` disables this behavior.  There is a separate
problem with `:set nowrap` that also applies to some other options.

related: #18214
related: #18399
closes: #18425

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2025-09-28 17:29:19 +00:00
committed by Christian Brabandt
parent ad43d2639d
commit 9d5208a931
7 changed files with 84 additions and 12 deletions

View File

@ -3081,6 +3081,7 @@ insecure_flag(int opt_idx, int opt_flags)
if (opt_flags & OPT_LOCAL)
switch ((int)options[opt_idx].indir)
{
case PV_WRAP: return &curwin->w_p_wrap_flags;
#ifdef FEAT_STL_OPT
case PV_STL: return &curwin->w_p_stl_flags;
#endif