From 82aa6e09e02b138ab7ee6b79ecac487813f117e5 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 17 Jan 2021 22:04:02 +0100 Subject: [PATCH] patch 8.2.2374: accessing uninitialized memory in test_undo MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Problem: Accessing uninitialized memory in test_undo. Solution: Do not look in typebuf.tb_buf if it is empty. (Dominique Pellé, closes #7697) --- src/edit.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/edit.c b/src/edit.c index a152d8449..35e4bc2c4 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] == ';') diff --git a/src/version.c b/src/version.c index f1b728048..98f120b2e 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2374, /**/ 2373, /**/ -- 2.40.0