aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-03-06 12:14:39 -0500
committerJames McCoy <jamessan@jamessan.com>2017-03-06 15:36:09 -0500
commit4e3a2784ec3cb4ff79bd48f55a8edee817dec6e7 (patch)
tree89cbc731234cffd3981c2692928a20d7c0f0a8da /src
parent7217360e349ff787933d91b55efdfeb435eb45cb (diff)
downloadrneovim-4e3a2784ec3cb4ff79bd48f55a8edee817dec6e7.tar.gz
rneovim-4e3a2784ec3cb4ff79bd48f55a8edee817dec6e7.tar.bz2
rneovim-4e3a2784ec3cb4ff79bd48f55a8edee817dec6e7.zip
vim-patch:7.4.2068
Problem: Not all arguments of trunc_string() are tested. Memory access error when running the message tests. Solution: Add another test case. (Yegappan Lakshmanan) Make it easy to run unittests with valgrind. Fix the access error. https://github.com/vim/vim/commit/b9644433d2728e99fab874e5e33147ad95d23a31
Diffstat (limited to 'src')
-rw-r--r--src/nvim/message.c4
-rw-r--r--src/nvim/version.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 57f7369e73..689e8893bd 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -274,9 +274,9 @@ void trunc_string(char_u *s, char_u *buf, int room, int buflen)
for (;;) {
do {
half = half - (*mb_head_off)(s, s + half - 1) - 1;
- } while (utf_iscomposing(utf_ptr2char(s + half)) && half > 0);
+ } while (half > 0 && utf_iscomposing(utf_ptr2char(s + half)));
n = ptr2cells(s + half);
- if (len + n > room) {
+ if (len + n > room || half == 0) {
break;
}
len += n;
diff --git a/src/nvim/version.c b/src/nvim/version.c
index b755404a58..abd3b7dfc3 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -372,7 +372,7 @@ static int included_patches[] = {
2071,
// 2070 NA
// 2069,
- // 2068,
+ 2068,
2067,
2066,
2065,