diff options
author | Daniel Kraft <d@domob.eu> | 2018-07-06 15:54:03 +0200 |
---|---|---|
committer | Daniel Kraft <d@domob.eu> | 2018-07-07 14:25:09 +0200 |
commit | 57889e688dd0987a1e087cd48d216a413127601e (patch) | |
tree | fcdc718f8cb7f89da4ae4f58895f8b8bd0f6ad7d /test/functional/rpc_txoutproof.py | |
parent | 0212187fc624ea4a02fc99bc57ebd413499a9ee1 (diff) | |
download | bitcoin-57889e688dd0987a1e087cd48d216a413127601e.tar.xz |
bitcoin-tx: Stricter check for valid integers
Just calling atoi to convert strings to integers does not check for
valid integers very thoroughly; in particular, it just ignores
everything starting from the first non-numeral character. Even a string
like "foo" is fine and silently returns 0.
This meant that bitcoin-tx would not fail if such a string was passed in
various places where an integer is expected (like the locktime or an
input/output index); this means that it would, for instance, silently
accept a typo and interpret it in an unexpected way.
In this change, we use ParseInt64 for parsing strings to integers,
which actually verifies that the full string is valid as number.
New tests in the bitcoin-util-test cover the new error paths.
Diffstat (limited to 'test/functional/rpc_txoutproof.py')
0 files changed, 0 insertions, 0 deletions