Project

General

Profile

Actions

Bug #13777

closed
MV MV

Disallow WTreeView and WStandardModel invalid indices to be removed

Bug #13777: Disallow WTreeView and WStandardModel invalid indices to be removed

Added by Matthias Van Ceulebroeck about 1 year ago. Updated 7 months ago.

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

100%

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()

MV Updated by Matthias Van Ceulebroeck about 1 year ago Actions #1

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

RM Updated by Romain Mardulyn about 1 year ago Actions #2

  • Assignee set to Romain Mardulyn

MV Updated by Matthias Van Ceulebroeck 8 months ago Actions #3

  • Status changed from Review to Implemented @Emweb
  • Assignee changed from Romain Mardulyn to Matthias Van Ceulebroeck
  • % Done changed from 0 to 100

RM Updated by Romain Mardulyn 7 months ago Actions #4

  • Status changed from Implemented @Emweb to Closed
Actions

Also available in: PDF Atom