aboutsummaryrefslogtreecommitdiff
path: root/src/chainparamsbase.h
diff options
context:
space:
mode:
authorDaniel Kraft <d@domob.eu>2018-07-06 15:54:03 +0200
committerDaniel Kraft <d@domob.eu>2018-07-07 14:25:09 +0200
commit57889e688dd0987a1e087cd48d216a413127601e (patch)
treefcdc718f8cb7f89da4ae4f58895f8b8bd0f6ad7d /src/chainparamsbase.h
parent0212187fc624ea4a02fc99bc57ebd413499a9ee1 (diff)
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 'src/chainparamsbase.h')
0 files changed, 0 insertions, 0 deletions