Project

General

Profile

Actions

Bug #13777

open

Disallow WTreeView and WStandardModel invalid indices to be removed

Added by Matthias Van Ceulebroeck 1 day ago. Updated about 9 hours ago.

Status:
Review
Priority:
Normal
Target version:
Start date:
06/17/2025
Due date:
% Done:

0%

Estimated time:

Description

When removing rows from WTreeView, it is possible that an invalid index is taken out, but triggers a segfault in

#0 Wt::WTreeViewNode::renderedRow(int, int) /home/matthias/Documents/wt/src/Wt/WTreeView.C:872                                                                                                                                               
#1 Wt::WTreeView::modelRowsAboutToBeRemoved(Wt::WModelIndex const&, int, int) /home/matthias/Documents/wt/src/Wt/WTreeView.C:2227    

Where the WTreeViewNode itself is a nullptr.
This can be the case when an invalid widget is taken. An assert exists here, which does trigger, but of course is no longer present in release binaries.

We should guard these against invalid indices:

  1. a model row removal
  2. WStandardItem::takeRow()
Actions #1

Updated by Matthias Van Ceulebroeck 1 day ago

  • Status changed from InProgress to Review
  • Assignee deleted (Matthias Van Ceulebroeck)
Actions #2

Updated by Romain Mardulyn about 9 hours ago

  • Assignee set to Romain Mardulyn
Actions

Also available in: Atom PDF