patch 8.2.2374: accessing uninitialized memory in test_undo
Problem: Accessing uninitialized memory in test_undo.
Solution: Do not look in typebuf.tb_buf if it is empty. (Dominique Pellé,
closes #7697)
diff --git a/src/edit.c b/src/edit.c
index a152d84..35e4bc2 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -1586,7 +1586,7 @@
// 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] == ';')