Skip to content

Commit 5958f95

Browse files
committed
patch 8.1.0538: evaluating a modeline might invoke using a shell command
Problem: Evaluating a modeline might invoke using a shell command. (Paul Huber) Solution: Set the sandbox flag when setting options from a modeline.
1 parent 48d23bb commit 5958f95

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/buffer.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5522,7 +5522,12 @@ chk_modeline(
55225522
current_sctx.sc_seq = 0;
55235523
current_sctx.sc_lnum = 0;
55245524
#endif
5525+
// Make sure no risky things are executed as a side effect.
5526+
++sandbox;
5527+
55255528
retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags);
5529+
5530+
--sandbox;
55265531
#ifdef FEAT_EVAL
55275532
current_sctx = save_current_sctx;
55285533
#endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,8 @@ static char *(features[]) =
792792

793793
static int included_patches[] =
794794
{ /* Add new patch number below this line */
795+
/**/
796+
538,
795797
/**/
796798
537,
797799
/**/

0 commit comments

Comments
 (0)