diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-27 19:27:16 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-27 19:27:16 +0000 |
commit | a4bc2dd7cccf5a4a9f78b58b6f35a45d17164323 (patch) | |
tree | 24f9080819f0ab341fe959e3d3c25da2417f9278 /src/getchar.c | |
parent | 98cd30383a378eb5f2dbf1b4e887fa17b5494a64 (diff) |
patch 8.2.4233: crash when recording and using Select modev8.2.4233
Problem: Crash when recording and using Select mode.
Solution: When deleting the last recorded character check there is something
to delete.
Diffstat (limited to 'src/getchar.c')
-rw-r--r-- | src/getchar.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/getchar.c b/src/getchar.c index c0dfc2b0b8..49eb3d7df9 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -252,8 +252,11 @@ add_buff( static void delete_buff_tail(buffheader_T *buf, int slen) { - int len = (int)STRLEN(buf->bh_curr->b_str); + int len; + if (buf->bh_curr == NULL || buf->bh_curr->b_str == NULL) + return; // nothing to delete + len = (int)STRLEN(buf->bh_curr->b_str); if (len >= slen) { buf->bh_curr->b_str[len - slen] = NUL; |