From 4e4d9d95cecaf28842808bdb215e83b7a03086f6 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Fri, 9 Dec 2022 15:52:34 +0100 Subject: [PATCH] Fix delimiter selection crash issue Fix #12384, close #12621 --- PowerEditor/src/NppNotification.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index 784e5e9d7..5bb5c4d96 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -752,6 +752,9 @@ BOOL Notepad_plus::notify(SCNotification *notification) // which are closest to the clicked position. for (int32_t i = static_cast(position_of_click); i >= 0; --i) { + if (i >= static_cast(bufstring.size())) + return FALSE; + if (bufstring.at(i) == nppGUI._leftmostDelimiter) { // Respect escaped quotation marks.