Skip to content

Conversation

@jonasschnelli
Copy link
Contributor

@jonasschnelli jonasschnelli commented Sep 14, 2017

QButtonGroup->button() may return a nullptr.
Accessing the object directly with setChecked seems fragile.

This is a simple fix to ensure to never call a button out of bounds (nullptr).

There are probably other places where a sanity check for QSettings are required.

Found by @achow101.
Code by @TheBlueMatt.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laanwj
Copy link
Member

laanwj commented Sep 14, 2017

Commit message needs to credit @achow101 for finding this :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

groupCustomFee might not be the best name for this variable, after all it's a button not a group (also snake_case?)

@jonasschnelli jonasschnelli force-pushed the 2017/09/qsettings_1 branch 2 times, most recently from a703bd4 to e45f21c Compare September 14, 2017 20:30
@jonasschnelli
Copy link
Contributor Author

Updated with the simpler solution by @TheBlueMatt (from 6ba2214).

Credited @achow101.

@jonasschnelli
Copy link
Contributor Author

This is a back-portable short fix and for 0.16 we should consider removing the group entirely (over further overhaul the custom fee settings)

A button was removed, so now button(1) is nullptr
@gmaxwell
Copy link
Contributor

utACK

3 similar comments
@luke-jr
Copy link
Member

luke-jr commented Sep 15, 2017

utACK

@meshcollider
Copy link
Contributor

utACK

@achow101
Copy link
Member

utACK

@maflcko
Copy link
Member

maflcko commented Sep 15, 2017

utACK cdaf3a1

@maflcko maflcko changed the title Fix possible crash with invalid nCustomFeeRadio in QSettings Fix possible crash with invalid nCustomFeeRadio in QSettings (achow101, TheBlueMatt) Sep 15, 2017
@laanwj laanwj merged commit cdaf3a1 into bitcoin:master Sep 15, 2017
laanwj added a commit that referenced this pull request Sep 15, 2017
…tings (achow101, TheBlueMatt)

cdaf3a1 Fix Qt 0.14.2->0.15.0 segfault if "total at least" is selected (Matt Corallo)

Pull request description:

  `QButtonGroup->button()` may return a nullptr.
  Accessing the object directly with `setChecked` seems fragile.

  This is a simple fix to ensure to never call a button out of bounds (nullptr).

  There are probably other places where a sanity check for `QSettings` are required.

  Found by @achow101.
  Code by @TheBlueMatt.

Tree-SHA512: a1b5d6636382a4e20c4e66ef82de19e6daa8b1b5f21b0f2bc5f51cfb6b37797045c7e29ebead8088ee2b990ed12c549c217cae6aad7566319599d086d526f6dc
laanwj pushed a commit that referenced this pull request Sep 15, 2017
A button was removed, so now button(1) is nullptr

Github-Pull: #11332
Rebased-From: cdaf3a1
Tree-SHA512: 0a49bf4e9ab08e5869170c8a212da60c9a6b90c36427d788de384aa4be6d87bb5e00a21edf78eed34f81bbc554b6f15565bb9b493dafcbfe9d6f4664d7424d9d
laanwj added a commit that referenced this pull request Sep 20, 2017
…Radio setting

e53fa4a Remove custom fee radio group (Andrew Chow)

Pull request description:

  Removes the extraneous custom fee radio group and its single radio button. The radio button is replaced with a label that has the radio button's text.

  Continuation of #11332

Tree-SHA512: b47b675f900ee4e2f4823203a42bb697f707ba67a8504d730c53d4dae511d0ed03226af34efd7ea45570c6111f8b3b6c39ac28f1b5c090de225903442ad4159a
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Feb 16, 2019
Summary:
introduced in D2322 backport

Didn't affect most people, only those who had custom fee selected (which required using Coin Control)

Workaround for affected users: change nCustomFeeRadio=1 to nCustomFeeRadio=0 in the ~/.config/BitcoinABC/<whatever>.conf file.

same fix was also required in core: bitcoin/bitcoin#11332

Test Plan: it runs now!

Reviewers: #bitcoin_abc, deadalnix, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Subscribers: teamcity, schancel

Differential Revision: https://reviews.bitcoinabc.org/D2559
codablock pushed a commit to codablock/dash that referenced this pull request Sep 23, 2019
…stomFeeRadio setting

e53fa4a Remove custom fee radio group (Andrew Chow)

Pull request description:

  Removes the extraneous custom fee radio group and its single radio button. The radio button is replaced with a label that has the radio button's text.

  Continuation of bitcoin#11332

Tree-SHA512: b47b675f900ee4e2f4823203a42bb697f707ba67a8504d730c53d4dae511d0ed03226af34efd7ea45570c6111f8b3b6c39ac28f1b5c090de225903442ad4159a
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants