diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-06-25 11:48:54 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-06-25 11:48:54 +0200 |
commit | 78159bbf9e241f162b1243853f45d08a3d81f1be (patch) | |
tree | 9e2d9def09f36f4c3c3a9842b2a8bb9b388825a6 /src/option.c | |
parent | e8d1f20cbd425e33e4fcc09d46f98e5c9e6a833e (diff) | |
download | vim-git-78159bbf9e241f162b1243853f45d08a3d81f1be.tar.gz |
updated for version 7.4.336v7.4.336
Problem: Setting 'history' to a big value causes out-of-memory errors.
Solution: Limit the value to 10000. (Hirohito Higashi)
Diffstat (limited to 'src/option.c')
-rw-r--r-- | src/option.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/option.c b/src/option.c index a36f8c0a0..f2f232e35 100644 --- a/src/option.c +++ b/src/option.c @@ -1392,7 +1392,7 @@ static struct vimoption SCRIPTID_INIT}, {"history", "hi", P_NUM|P_VIM, (char_u *)&p_hi, PV_NONE, - {(char_u *)0L, (char_u *)20L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)50L} SCRIPTID_INIT}, {"hkmap", "hk", P_BOOL|P_VI_DEF|P_VIM, #ifdef FEAT_RIGHTLEFT (char_u *)&p_hkmap, PV_NONE, @@ -8595,6 +8595,11 @@ set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags) errmsg = e_positive; p_hi = 0; } + else if (p_hi > 10000) + { + errmsg = e_invarg; + p_hi = 10000; + } if (p_re < 0 || p_re > 2) { errmsg = e_invarg; |