Fixes #15300
rpc: Fix for segfault if combinepsbt called with empty inputs #15337
pull benthecarman wants to merge 1 commits into bitcoin:master from benthecarman:rpc_combinepbst_empty_fix changing 2 files +6 −0-
benthecarman commented at 1:19 PM on February 4, 2019: contributor
- fanquake added the label RPC/REST/ZMQ on Feb 4, 2019
-
practicalswift commented at 3:30 PM on February 4, 2019: contributor
Concept ACK and thanks for fixing.
Is it worth checking if we have this problem elsewhere where we're using
UniValue foo = request.params[n].get_array() -
benthecarman commented at 4:06 PM on February 4, 2019: contributor
@practicalswift I did a quick pass looking for uses of get_array() and didn't find any where else that caused a crash, however some gave errors that didn't seem to correlate with what would be going wrong.
-
in src/rpc/rawtransaction.cpp:1517 in ff918ebd2c outdated
1513 | @@ -1514,6 +1514,9 @@ UniValue combinepsbt(const JSONRPCRequest& request) 1514 | // Unserialize the transactions 1515 | std::vector<PartiallySignedTransaction> psbtxs; 1516 | UniValue txs = request.params[0].get_array(); 1517 | + if (txs.size() <= 0) {
promag commented at 7:41 PM on February 4, 2019:if (txs.empty()) {in src/rpc/rawtransaction.cpp:1518 in ff918ebd2c outdated
1513 | @@ -1514,6 +1514,9 @@ UniValue combinepsbt(const JSONRPCRequest& request) 1514 | // Unserialize the transactions 1515 | std::vector<PartiallySignedTransaction> psbtxs; 1516 | UniValue txs = request.params[0].get_array(); 1517 | + if (txs.size() <= 0) { 1518 | + throw JSONRPCError(RPC_INVALID_PARAMETER, "Parameter \'txs\' cannot be empty");
promag commented at 7:42 PM on February 4, 2019:Why
\'?
benthecarman commented at 8:27 PM on February 4, 2019:No particular reason, I figured it made the
txspart stick out more
practicalswift commented at 8:41 PM on February 4, 2019:'doesn't have to be quoted :-)
benthecarman commented at 8:48 PM on February 4, 2019:TIL
rpc: Fix for segfault if combinepsbt called with empty inputs 30d0f7be6ebenthecarman force-pushed on Feb 5, 2019Sjors commented at 12:39 PM on February 11, 2019: membertACK 30d0f7b
MarcoFalke added this to the milestone 0.18.0 on Feb 11, 2019MarcoFalke merged this on Feb 11, 2019MarcoFalke closed this on Feb 11, 2019MarcoFalke referenced this in commit e84e0d4b5e on Feb 11, 2019benthecarman deleted the branch on Feb 11, 2019deadalnix referenced this in commit 18b7c86119 on Jun 15, 2020ftrader referenced this in commit fad5d8f467 on Aug 17, 2020linuxsh2 referenced this in commit 457ea759a2 on Jul 30, 2021linuxsh2 referenced this in commit 8ce5b6b099 on Aug 3, 2021DrahtBot locked this on Dec 16, 2021ContributorsLabelsMilestone
0.18.0
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me