From 6e60cf444a8839ca1694319bf9a82e7b097e5c4d Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sun, 3 Sep 2023 21:43:46 +0200 Subject: 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 --- src/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/buffer.c') diff --git a/src/buffer.c b/src/buffer.c index 14eac92b97..93f9245f27 100644 --- 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 -- cgit v1.2.3