Skip to content

Commit

Permalink
Merge #12211: Avoid potential null dereference in ReceiveCoinsDialog …
Browse files Browse the repository at this point in the history
…constructor

cc90a4f Avoid potential null dereference in ReceiveCoinsDialog constructor (Russell Yanofsky)

Pull request description:

  Not a bug in practice because current `WalletModel::getDefaultAddressType()` implementation does not dereference its `this` pointer.

  Encountered issue while rebasing #10244 after #11991 was merged.

Tree-SHA512: d76afc410d4a436ec62936196fdac1af89c221d8c0d6e73349024afe55bbf8820f843177a8fe8210aa8021d45a17a0ecd9b6f693381e3edb234d9897cece29d7
  • Loading branch information
jonasschnelli committed Jan 18, 2018
2 parents 898f560 + cc90a4f commit 10d10d7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/qt/receivecoinsdialog.cpp
Expand Up @@ -43,15 +43,6 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWid
ui->removeRequestButton->setIcon(_platformStyle->SingleColorIcon(":/icons/remove"));
}

// configure bech32 checkbox, disable if launched with legacy as default:
if (model->getDefaultAddressType() == OUTPUT_TYPE_BECH32) {
ui->useBech32->setCheckState(Qt::Checked);
} else {
ui->useBech32->setCheckState(Qt::Unchecked);
}

ui->useBech32->setVisible(model->getDefaultAddressType() != OUTPUT_TYPE_LEGACY);

// context menu actions
QAction *copyURIAction = new QAction(tr("Copy URI"), this);
QAction *copyLabelAction = new QAction(tr("Copy label"), this);
Expand Down Expand Up @@ -102,6 +93,15 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
SLOT(recentRequestsView_selectionChanged(QItemSelection, QItemSelection)));
// Last 2 columns are set by the columnResizingFixer, when the table geometry is ready.
columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(tableView, AMOUNT_MINIMUM_COLUMN_WIDTH, DATE_COLUMN_WIDTH, this);

// configure bech32 checkbox, disable if launched with legacy as default:
if (model->getDefaultAddressType() == OUTPUT_TYPE_BECH32) {
ui->useBech32->setCheckState(Qt::Checked);
} else {
ui->useBech32->setCheckState(Qt::Unchecked);
}

ui->useBech32->setVisible(model->getDefaultAddressType() != OUTPUT_TYPE_LEGACY);
}
}

Expand Down

0 comments on commit 10d10d7

Please sign in to comment.