HomePhabricator

qt: Avoid crash on startup if int specified in settings.json

Description

qt: Avoid crash on startup if int specified in settings.json

Summary:

test: Add tests for GetArg methods / settings.json type coercion

qt: Avoid crash on startup if int specified in settings.json

Fix GUI startup crash reported by Rspigler in issue core#24457 that happens if settings.json contains an integer value for any of the configuration options which GUI settings can currently clash with (-dbcache, -par, -spendzeroconfchange, -signer, -upnp, -natpmp, -listen, -server, -proxy, -proxy, -onion, -onion, -lang, and -prune).

The fix is a one-line change in ArgsManager::GetArg. The rest of the PR just adds a regression test for the GUI and unit tests for ArgsManager::GetArg methods.

This is a backport of core#24498
Depends on D15264

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D15265

Details

Provenance
Ryan Ofsky <ryan@ofsky.org>Authored on Mar 7 2022, 18:29
PiRKCommitted on Jan 24 2024, 15:28
PiRKPushed on Jan 24 2024, 15:28
Reviewer
Restricted Project
Differential Revision
D15265: qt: Avoid crash on startup if int specified in settings.json
Parents
rABC524c5c09465f: Do not use `LocalTestingSetup` in getarg_tests test file.
Branches
Unknown
Tags
Unknown