summaryrefslogtreecommitdiffstats
path: root/src/edit.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-01-17 22:04:02 +0100
committerBram Moolenaar <Bram@vim.org>2021-01-17 22:04:02 +0100
commit82aa6e09e02b138ab7ee6b79ecac487813f117e5 (patch)
treed0a7cb1a7de006d723b18f77da135788c63bb435 /src/edit.c
parentf30a14db3b26e510f193f50ee0dd8a41303e4740 (diff)
patch 8.2.2374: accessing uninitialized memory in test_undov8.2.2374
Problem: Accessing uninitialized memory in test_undo. Solution: Do not look in typebuf.tb_buf if it is empty. (Dominique Pellé, closes #7697)
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/edit.c b/src/edit.c
index a152d84499..35e4bc2c4b 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -1586,7 +1586,7 @@ decodeModifyOtherKeys(int c)
// Recognize:
// form 0: {lead}{key};{modifier}u
// form 1: {lead}27;{modifier};{key}~
- if ((c == CSI || (c == ESC && *p == '[')) && typebuf.tb_len >= 4)
+ if (typebuf.tb_len >= 4 && (c == CSI || (c == ESC && *p == '[')))
{
idx = (*p == '[');
if (p[idx] == '2' && p[idx + 1] == '7' && p[idx + 2] == ';')