From acb6493da09f6df31897b266341978fcc7fddce5 Mon Sep 17 00:00:00 2001 From: Carlos Aurelio Date: Thu, 27 Nov 2025 11:09:29 +0000 Subject: 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 --- src/kitemviews/private/kitemlistheaderwidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') 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 -- cgit v1.3