diff options
| author | Felix Ernst <[email protected]> | 2023-01-08 15:07:16 +0100 |
|---|---|---|
| committer | Felix Ernst <[email protected]> | 2023-01-08 15:07:16 +0100 |
| commit | eede5747237ac736340b01ad5b913f479011ddff (patch) | |
| tree | 1c3076d7438764cdeec82f257a1153961ac0015e /src/selectionmode | |
| parent | 1ea868f2f8e328ab09487ed1f7e0ba053adcf552 (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.cpp | 2 |
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); |
