mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
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.
This commit is contained in:
@@ -5522,7 +5522,12 @@ chk_modeline(
|
|||||||
current_sctx.sc_seq = 0;
|
current_sctx.sc_seq = 0;
|
||||||
current_sctx.sc_lnum = 0;
|
current_sctx.sc_lnum = 0;
|
||||||
#endif
|
#endif
|
||||||
|
// Make sure no risky things are executed as a side effect.
|
||||||
|
++sandbox;
|
||||||
|
|
||||||
retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags);
|
retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags);
|
||||||
|
|
||||||
|
--sandbox;
|
||||||
#ifdef FEAT_EVAL
|
#ifdef FEAT_EVAL
|
||||||
current_sctx = save_current_sctx;
|
current_sctx = save_current_sctx;
|
||||||
#endif
|
#endif
|
||||||
|
@@ -792,6 +792,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
538,
|
||||||
/**/
|
/**/
|
||||||
537,
|
537,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user