aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Walch <florian@fwalch.com>2014-12-24 14:32:42 +0100
committerFlorian Walch <florian@fwalch.com>2014-12-25 18:54:12 +0100
commit4ad5b245f0eba86ea5091d9e344e136af6f4ebec (patch)
tree23535aaae868207915aee5fbfb51f4d5a1e5f8df /src
parent59985523b851fe61b62afcef69f4564f064cbc0a (diff)
downloadrneovim-4ad5b245f0eba86ea5091d9e344e136af6f4ebec.tar.gz
rneovim-4ad5b245f0eba86ea5091d9e344e136af6f4ebec.tar.bz2
rneovim-4ad5b245f0eba86ea5091d9e344e136af6f4ebec.zip
vim-patch:7.4.541
Problem: Crash when doing a range assign. Solution: Check for NULL poiter. (Yukihiro Nakadaira) https://code.google.com/p/vim/source/detail?r=v7-4-541
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.c2
-rw-r--r--src/nvim/testdir/test55.in5
-rw-r--r--src/nvim/testdir/test55.ok1
-rw-r--r--src/nvim/version.c2
4 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 116944b28d..97d778327b 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -2247,7 +2247,7 @@ static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv, int copy, ch
int ll_n1 = lp->ll_n1;
// Check whether any of the list items is locked
- for (listitem_T *ri = rettv->vval.v_list->lv_first; ri != NULL; ) {
+ for (listitem_T *ri = rettv->vval.v_list->lv_first; ri != NULL && ll_li != NULL; ) {
if (tv_check_lock(ll_li->li_tv.v_lock, lp->ll_name)) {
return;
}
diff --git a/src/nvim/testdir/test55.in b/src/nvim/testdir/test55.in
index 140cb7c0e5..c4e82d429c 100644
--- a/src/nvim/testdir/test55.in
+++ b/src/nvim/testdir/test55.in
@@ -401,6 +401,11 @@ let l = [0, 1, 2, 3]
: $put =v:exception[:15] . v:exception[-1:-1]
:endtry
:$put =string(d)
+:"
+:" test for range assign
+:let l = [0]
+:let l[:] = [1, 2]
+:$put =string(l)
:endfun
:"
:call Test(1, 2, [3, 4], {5: 6}) " This may take a while
diff --git a/src/nvim/testdir/test55.ok b/src/nvim/testdir/test55.ok
index e8560de401..ba029b2898 100644
--- a/src/nvim/testdir/test55.ok
+++ b/src/nvim/testdir/test55.ok
@@ -129,6 +129,7 @@ caught a:000[3]
{'a': {'b': 'B'}}
Vim(call):E737: a
{'a': {'b': 'B'}}
+[1, 2]
Vim(foldopen):E490:
diff --git a/src/nvim/version.c b/src/nvim/version.c
index b469d0e804..ffa9bc73a7 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -197,7 +197,7 @@ static int included_patches[] = {
//544 NA
543,
//542,
- //541,
+ 541,
//540 NA
//539,
//538,