gui: Fix proxy setting options dialog crash
commitf05d34988719b22ef5c64888f90b4c8f3a2c7931
authorWladimir J. van der Laan <laanwj@gmail.com>
Fri, 1 Dec 2017 11:08:31 +0000 (1 12:08 +0100)
committerWladimir J. van der Laan <laanwj@gmail.com>
Thu, 7 Dec 2017 16:34:16 +0000 (7 17:34 +0100)
treecaf39100cf1aa4cf7c1447908c5d6fd429c8ea70
parent16fff802574159286e424802442551dc9eba9098
gui: Fix proxy setting options dialog crash

This fixes a crash bug when opening the options dialog.

- Check the return value of split() to avoid segmentation faults due to
  out of bounds when the user manages to enter invalid proxy settings.
  This is reported resonably often.

- Move the default proxy/port to a constant instead of hardcoding magic
  values.

- Factor out some common code.

- Revert #11448 because this proves a more robust replacement, it is no
  longer necessary and didn't generally solve the issue.

No attempt is made to do full sanity checking on the proxy, so it can
still be rejected by the core with an InitError message.
src/qt/optionsdialog.cpp
src/qt/optionsmodel.cpp
src/qt/optionsmodel.h