┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/private
diff options
context:
space:
mode:
authorCarlos Aurelio <[email protected]>2025-11-27 11:09:29 +0000
committerMéven Car <[email protected]>2025-11-27 11:09:29 +0000
commitacb6493da09f6df31897b266341978fcc7fddce5 (patch)
tree8a9324393eb9c757623a5ccc07437663a31eaeef /src/kitemviews/private
parent2adbecd269e3694c2796374260c1983a8d21764d (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')
-rw-r--r--src/kitemviews/private/kitemlistheaderwidget.cpp4
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