Skip to content

Commit 615d9e2

Browse files
committed
Fix possible out of bounds access in WTableView::itemWidget
May or may not be related to issue #7000 In the previous condition, it would accept the index if its column is less than the rowHeaderCount() i.e. it is a row header column. It would not look if the row was actually rendered, but it should also check that.
1 parent f3b6e75 commit 615d9e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Wt/WTableView.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,8 +1958,8 @@ int WTableView::renderedColumnsCount() const
19581958

19591959
WWidget *WTableView::itemWidget(const WModelIndex& index) const
19601960
{
1961-
if (index.column() < rowHeaderCount() ||
1962-
(isRowRendered(index.row()) && isColumnRendered(index.column())))
1961+
if ((index.column() < rowHeaderCount() || isColumnRendered(index.column())) &&
1962+
isRowRendered(index.row()))
19631963
{
19641964
int renderedRow = index.row() - firstRow();
19651965
int renderedCol;

0 commit comments

Comments
 (0)