diff src/buffer.c @ 33154:faeeed7df688 v9.0.1859

patch 9.0.1859: heap-use-after-free in bt_normal() Commit: https://github.com/vim/vim/commit/6e60cf444a8839ca1694319bf9a82e7b097e5c4d Author: Christian Brabandt <cb@256bit.org> Date: Sun Sep 3 21:43:46 2023 +0200 patch 9.0.1859: heap-use-after-free in bt_normal() Problem: heap-use-after-free in bt_normal() Solution: check that buffer is still valid Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 03 Sep 2023 22:00:02 +0200
parents 5dfaba11d7c3
children 1947bb095199
line wrap: on
line diff
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5777,7 +5777,7 @@ bt_normal(buf_T *buf)
 bt_quickfix(buf_T *buf UNUSED)
 {
 #ifdef FEAT_QUICKFIX
-    return buf != NULL && buf->b_p_bt[0] == 'q';
+    return buf != NULL && buf_valid(buf) && buf->b_p_bt[0] == 'q';
 #else
     return FALSE;
 #endif