HomePhabricator

[Qt] prevent amount overflow problem with payment requests
a6516686dcf0Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

[Qt] prevent amount overflow problem with payment requests

Bitcoin amounts are stored as uint64 in the protobuf messages (see
paymentrequest.proto), but CAmount is defined as int64_t. Because
of that we need to verify that single and accumulated amounts are
in a valid range and no variable overflow has happened.

  • fixes #5624 (#5622)

Thanks @SergioDemianLerner for reporting that issue and also supplying us
with a possible solution.

  • add static verifyAmount() function to PaymentServer and move the logging on error into the function
  • also add a unit test to paymentservertests.cpp

Details

Provenance
Philip Kaufmann <phil.kaufmann@t-online.de>Authored on Jan 9 2015, 13:25
schancelPushed on Jan 5 2018, 21:58
schancelPushed on Jan 5 2018, 21:39
schancelPushed on Jan 5 2018, 21:17
Parents
rSTAGING31dedb463b0c: Merge pull request #5509
Branches
Unknown
Tags
Unknown

Event Timeline

Philip Kaufmann <phil.kaufmann@t-online.de> committed rSTAGINGa6516686dcf0: [Qt] prevent amount overflow problem with payment requests (authored by Philip Kaufmann <phil.kaufmann@t-online.de>).Feb 4 2015, 12:47