diff options
| author | Carlos Aurelio <[email protected]> | 2025-11-27 11:09:29 +0000 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2025-11-27 11:09:29 +0000 |
| commit | acb6493da09f6df31897b266341978fcc7fddce5 (patch) | |
| tree | 8a9324393eb9c757623a5ccc07437663a31eaeef /src/kitemviews/private/kitemlistheaderwidget.cpp | |
| parent | 2adbecd269e3694c2796374260c1983a8d21764d (diff) | |
kitemviews: Prevent crash when dragging details side padding header
Calling createRolePixmap() while roleIndex is < 0 (which is the case for
the header side padding) would cause access to a negative index of a
vector, so exit the function before so and do nothing.
BUG: 511057
Diffstat (limited to 'src/kitemviews/private/kitemlistheaderwidget.cpp')
| -rw-r--r-- | src/kitemviews/private/kitemlistheaderwidget.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/kitemviews/private/kitemlistheaderwidget.cpp b/src/kitemviews/private/kitemlistheaderwidget.cpp index 08afdc5cf..c598e5fb2 100644 --- a/src/kitemviews/private/kitemlistheaderwidget.cpp +++ b/src/kitemviews/private/kitemlistheaderwidget.cpp @@ -355,6 +355,10 @@ void KItemListHeaderWidget::mouseMoveEvent(QGraphicsSceneMouseEvent *event) // synchronized on each further mouse-move-event with the mouse-position. const int roleIndex = roleIndexAt(m_pressedMousePos); m_movingRole.index = roleIndex; + if (roleIndex < 0) { + // Trying to drag side padding + return; + } if (roleIndex == nameColumnIndex(this)) { // TODO: It should be configurable whether moving the first role is allowed. // In the context of Dolphin this is not required, however this should be |
