┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/selectionmode
diff options
context:
space:
mode:
authorFelix Ernst <[email protected]>2023-01-08 15:07:16 +0100
committerFelix Ernst <[email protected]>2023-01-08 15:07:16 +0100
commiteede5747237ac736340b01ad5b913f479011ddff (patch)
tree1c3076d7438764cdeec82f257a1153961ac0015e /src/selectionmode
parent1ea868f2f8e328ab09487ed1f7e0ba053adcf552 (diff)
Fix potential nullptr de-reference
The `break` that is replaced by a `return` here would only break out of the innermost while loop so the std::vector::end could still become accessed after that. By returning here we completely exit out of both nested loops and therefore don't access the std::vector::end.
Diffstat (limited to 'src/selectionmode')
-rw-r--r--src/selectionmode/backgroundcolorhelper.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/selectionmode/backgroundcolorhelper.cpp b/src/selectionmode/backgroundcolorhelper.cpp
index 893a75ccf..799db43d5 100644
--- a/src/selectionmode/backgroundcolorhelper.cpp
+++ b/src/selectionmode/backgroundcolorhelper.cpp
@@ -56,7 +56,7 @@ void BackgroundColorHelper::slotPaletteChanged()
while (!*i) {
i = m_colorControlledWidgets.erase(i);
if (i == m_colorControlledWidgets.end()) {
- break;
+ return;
}
}
setBackgroundColorForWidget(*i, m_backgroundColor);