Skip to content

Conversation

@achow101
Copy link
Member

@achow101 achow101 commented Aug 9, 2022

Fixes #25749

Copy link
Member

@darosior darosior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK befa2a76da4adb5140b4870cd241c38e8ae2e0d0

@fanquake fanquake requested a review from instagibbs August 10, 2022 14:40
@instagibbs
Copy link
Member

can we catch this in test?

@achow101
Copy link
Member Author

Added a test case.

@achow101 achow101 force-pushed the psbt-hd-path-int-overflow branch from befa2a7 to 70a55c0 Compare August 10, 2022 15:58
@instagibbs
Copy link
Member

ACK 70a55c0

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review ACK 70a55c0, this should avoid the issue reported in #25749

Error message with the new test, without the code change in psbt.h:

TX decode failed Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)

Error message with the new test and the code change in psbt.h:

TX decode failed Input Taproot BIP32 keypath has an invalid length

Unrelated: it may be good as a follow-up to add a colon at the end of "TX decode failed" before appending the specific error message.

for invalid in invalids:
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].decodepsbt, invalid)
for invalid in invalid_with_msgs:
psbt, msg = invalid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you retouch

-        for invalid in invalid_with_msgs:
-            psbt, msg = invalid
+        for psbt, msg in invalid_with_msgs:

@darosior
Copy link
Member

re-utACK 70a55c0

@fanquake fanquake merged commit 0094ff3 into bitcoin:master Aug 11, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Aug 11, 2022
…_BIP32_DERIVATION

70a55c0 psbt: Avoid unsigned int overflow in PSBT_IN_TAP_BIP32_DERIVATION (Andrew Chow)

Pull request description:

  Fixes bitcoin#25749

ACKs for top commit:
  instagibbs:
    ACK 70a55c0
  darosior:
    re-utACK 70a55c0
  jonatack:
    Review ACK 70a55c0, this should avoid the issue reported in bitcoin#25749

Tree-SHA512: 6bb58e1cda9a5baa50fcd24f818b5b27ed94f0d33da3f71f6e457618176611bf2a84e1864e9a48d9303c301252bc4c1dee8b19a67dd713e849fb9442851ca341
@bitcoin bitcoin locked and limited conversation to collaborators Aug 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

psbt.h:644:51: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned long'

6 participants