From ed5c2631c190af460e22ba39a7bc5ccb447d3aa2 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Tue, 31 Aug 2021 07:06:28 +0200 Subject: [PATCH] Fix asan(address sanitizer) issue with no plugins Fix #10470, close #10471 --- PowerEditor/src/Notepad_plus.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 1cb276f16..123ce0512 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -928,14 +928,17 @@ void Notepad_plus::saveDockingParams() else floatCont = nppGUI._dockingData._pluginDockInfo[i]._prevContainer; - if (floatContArray[floatCont] == 0) + if (floatCont >= 0) { - RECT rc; - if (nppGUI._dockingData.getFloatingRCFrom(floatCont, rc)) + if (floatContArray[floatCont] == 0) { - vFloatingWindowInfo.push_back(FloatingWindowInfo(floatCont, rc.left, rc.top, rc.right, rc.bottom)); + RECT rc; + if (nppGUI._dockingData.getFloatingRCFrom(floatCont, rc)) + { + vFloatingWindowInfo.push_back(FloatingWindowInfo(floatCont, rc.left, rc.top, rc.right, rc.bottom)); + } + floatContArray[floatCont] = 1; } - floatContArray[floatCont] = 1; } if (i < nppGUI._dockingData._pluginDockInfo.size()) // to prevent from crash in debug mode vPluginDockInfo.push_back(nppGUI._dockingData._pluginDockInfo[i]);