elements/src
muxator 8d24f56227 rpc: fix crash in deriveaddresses when derivation index is 2147483647
2147483647 is the maximum positive value of a signed int32, and - currently -
the maximum value that the deriveaddresses bitcoin RPC call accepts as
derivation index due to its input validation routines.

Before this change, when the derivation index (and thus range_end) reached
std::numeric_limits<int_32_t>::max(), the "i" variable in the for cycle (which
is declared as int, and as such 32 bits in size on most platforms) would be
incremented at the end of the first iteration and then warp back to
-2147483648. This caused SIGABRT in bitcoind and a core dump.

This change assigns "i" an explicit size of 64 bits on every platform,
sidestepping the problem.

Fixes #26274.

Github-Pull: #26275
Rebased-From: addf9d6502
(cherry picked from commit db20d278e212b2a393a331624184a61fab6c05c9)
2022-12-07 20:13:57 +00:00
..
bench Merge 1ba24fe9b3 into merged_master (Elements PR ElementsProject/elements#1002) 2021-09-04 22:14:42 +00:00
compat Remove support for double serialization 2021-05-24 16:15:05 -07:00
config
consensus consensus/params: simplify ValidDeployment check to avoid gcc warning 2022-08-01 15:35:06 -07:00
crc32c build: Update crc32c subtree 2020-12-08 19:26:30 +01:00
crypto Merge feee029d29 into merged_master (Elements PR ElementsProject/elements#1020) 2021-09-05 13:42:34 +00:00
index Merge a55904a80c into merged_master (Bitcoin PR bitcoin/bitcoin#21866) 2021-07-29 13:18:11 +00:00
init Make SetupServerArgs callable without NodeContext 2021-06-10 09:58:45 -05:00
interfaces Elements-qt: Correctly display the amount in the sender's wallet after using Send button 2022-08-31 19:12:50 -03:00
ipc multiprocess: Add echoipc RPC method and test 2021-04-23 03:02:50 -05:00
leveldb
logging
node consensus: don't call GetBlockPos in ReadBlockFromDisk without lock 2022-12-07 11:11:30 +00:00
policy fees: Always round up fee calculated from a feerate 2022-12-07 11:11:30 +00:00
primitives lint: fix non-pylint linter errors 2021-10-15 00:20:20 +00:00
qt Merge branch 'master' into elements_22_1_rc1 2022-12-07 10:47:10 +00:00
rpc rpc: fix crash in deriveaddresses when derivation index is 2147483647 2022-12-07 20:13:57 +00:00
script Fix tapscript comment 2022-08-12 11:56:15 -04:00
secp256k1 Merge commit '35d6112a72' into test-fix-1058 2022-05-25 15:18:23 -07:00
support Merge #20464: refactor: Treat CDataStream bytes as uint8_t 2021-02-01 15:17:28 +01:00
test Fix tests after backport of #22949 2022-12-07 11:11:30 +00:00
univalue Update univalue subtree 2020-11-19 15:48:24 +01:00
util qt: Avoid crash on startup if int specified in settings.json 2022-12-07 20:08:16 +00:00
wallet wallet: fix segfault by avoiding invalid default-ctored external_spk_managers entry 2022-12-07 11:11:30 +00:00
zmq zmq: use msg: prefix over errno= in zmqError 2021-06-09 19:25:13 +08:00
.clang-format [tools] Allow argument/parameter bin packing in clang-format 2021-02-18 10:07:37 +00:00
addrdb.cpp banman: save the banlist in a JSON format on disk 2021-06-21 14:39:44 +02:00
addrdb.h banman: save the banlist in a JSON format on disk 2021-06-21 14:39:44 +02:00
addrman.cpp scripted-diff: remove ResetI2PPorts() (revert e0a2b390c1) 2021-07-19 14:33:21 +02:00
addrman.h Merge bitcoin/bitcoin#22497: scripted-diff: remove ResetI2PPorts() (revert e0a2b390c1) 2021-07-20 09:02:34 +08:00
amount.h
arith_uint256.cpp
arith_uint256.h
asset.cpp
asset.h Merge dcacea096e into merged_master (Bitcoin PR #19032) 2020-11-26 01:08:50 +00:00
assetsdir.cpp Merge 544709763e into merged_master (Bitcoin PR #18571) 2020-11-26 01:08:20 +00:00
assetsdir.h Merge 544709763e into merged_master (Bitcoin PR #18571) 2020-11-26 01:08:20 +00:00
attributes.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
banman.cpp banman: save the banlist in a JSON format on disk 2021-06-21 14:39:44 +02:00
banman.h banman: save the banlist in a JSON format on disk 2021-06-21 14:39:44 +02:00
base58.cpp refactor: replace sizeof(a)/sizeof(a[0]) by std::size (C++17) 2021-01-31 17:35:16 +01:00
base58.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
bech32.cpp naming nits 2021-08-17 22:32:47 +00:00
bech32.h naming nits 2021-08-17 22:32:47 +00:00
bitcoin-cli-res.rc Merge d4159984c3 into merged_master (Bitcoin PR #20223) 2021-05-07 15:22:08 +00:00
bitcoin-cli.cpp Merge b2f5c38333 into merged_master (Bitcoin PR bitcoin/bitcoin#22327) 2021-07-29 03:27:27 +00:00
bitcoin-tx-res.rc Merge d4159984c3 into merged_master (Bitcoin PR #20223) 2021-05-07 15:22:08 +00:00
bitcoin-tx.cpp Merge 5c2e2afe99 into merged_master (Bitcoin PR bitcoin/bitcoin#21365) 2021-08-03 20:43:53 +00:00
bitcoin-util-res.rc Add bitcoin-util command line utility 2021-01-12 18:34:25 +10:00
bitcoin-util.cpp Fixes to manpage generation; regenerate manpages 2022-08-03 15:27:36 -07:00
bitcoin-wallet-res.rc Drop the leading 0 from the version number 2020-11-18 12:00:57 -05:00
bitcoin-wallet.cpp Merge a196c89317 into merged_master (Bitcoin PR bitcoin/bitcoin#22270) 2021-07-28 18:18:31 +00:00
bitcoind-res.rc Merge d4159984c3 into merged_master (Bitcoin PR #20223) 2021-05-07 15:22:08 +00:00
bitcoind.cpp Merge f66eceaecf into merged_master (Bitcoin PR bitcoin/bitcoin#22216) 2021-07-24 20:31:41 +00:00
blech32.cpp blech32: add blech32m format and use it to decode witness v1+ addresses 2021-08-18 15:54:20 +00:00
blech32.h blech32: add blech32m format and use it to decode witness v1+ addresses 2021-08-18 15:54:20 +00:00
blind.cpp lint: fix non-pylint linter errors 2021-10-15 00:20:20 +00:00
blind.h Use a constant for maximum surjection targets 2021-06-22 14:42:38 -04:00
blindpsbt.cpp Merge pull request #1186 from achow101/createfunded-explicit-value 2022-11-21 17:15:58 -03:00
blindpsbt.h blindpsbt: Expose CreateBlind{Asset,Value}Proof 2022-10-18 16:52:31 -04:00
block_proof.cpp lint: fix non-pylint linter errors 2021-10-15 00:20:20 +00:00
block_proof.h
blockencodings.cpp Merge 4a540683ec into merged_master (Bitcoin PR #20813) 2021-06-16 14:11:07 +00:00
blockencodings.h Merge 082a417abc into merged_master (Bitcoin PR #18635) 2020-11-26 01:08:51 +00:00
blockfilter.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
blockfilter.h
bloom.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
bloom.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
chain.cpp Merge 99813a9745 into merged_master (Bitcoin PR #17829) 2020-11-14 16:52:02 +00:00
chain.h Merge 346e52afd6 into merged_master (Bitcoin PR bitcoin/bitcoin#22121) 2021-07-22 13:24:16 +00:00
chainparams.cpp liquidtestnet: Add fixed seeds 2022-09-08 19:02:07 +00:00
chainparams.h Merge 1ba24fe9b3 into merged_master (Elements PR ElementsProject/elements#1002) 2021-09-04 22:14:42 +00:00
chainparamsbase.cpp liquidtestnet: Add chainparams 2022-09-08 19:01:27 +00:00
chainparamsbase.h liquidtestnet: Add chainparams 2022-09-08 19:01:27 +00:00
chainparamsseeds.h Merge branch 'master' into elements_22_1_rc1 2022-12-07 10:47:10 +00:00
checkqueue.h Merge b386d37360 into merged_master (Bitcoin PR #18710) 2021-06-18 19:12:18 +00:00
clientversion.cpp clientversion: No suffix #if CLIENT_VERSION_IS_RELEASE 2022-08-01 15:35:06 -07:00
clientversion.h refactor: Move STRINGIZE macro to macros.h 2021-02-01 22:30:05 +02:00
coins.cpp Merge 7317e14a44 into merged_master (Bitcoin PR bitcoin/bitcoin#22263) 2021-07-28 16:09:13 +00:00
coins.h Merge 7317e14a44 into merged_master (Bitcoin PR bitcoin/bitcoin#22263) 2021-07-28 16:09:13 +00:00
compat.h net: extend Sock with methods for robust send & read until terminator 2021-03-01 17:36:16 +01:00
compressor.cpp refactor: Use CPubKey vector constructor where possible 2021-05-04 06:53:32 +02:00
compressor.h Merge 4cfe6c37d9 into merged_master (Bitcoin PR bitcoin/bitcoin#18847) 2021-07-03 05:39:04 +00:00
confidential_validation.cpp Make it clear that the CRangeCheck is not called on explicit values 2021-02-18 11:12:59 +00:00
confidential_validation.h Merge 219c55da75 into merged_master (Bitcoin PR #16710) 2020-11-26 01:08:42 +00:00
core_io.h Merge 80862ff943 into merged_master (Elements PR ElementsProject/elements#1075) 2022-05-25 13:00:55 -07:00
core_memusage.h
core_read.cpp Merge 9a154599fe into merged_master (Elements PR ElementsProject/elements#900) 2021-09-04 19:34:14 +00:00
core_write.cpp Merge 80862ff943 into merged_master (Elements PR ElementsProject/elements#1075) 2022-05-25 13:00:55 -07:00
cuckoocache.h doc: Use https URLs where possible 2021-01-04 12:23:16 +08:00
dbwrapper.cpp refactor: Use only one temporary buffer in CreateObfuscateKey 2021-05-04 06:53:37 +02:00
dbwrapper.h Merge #20464: refactor: Treat CDataStream bytes as uint8_t 2021-02-01 15:17:28 +01:00
deploymentinfo.cpp Merge ddc6979b8b into merged_master (Bitcoin PR bitcoin/bitcoin#19438) 2021-07-30 16:16:50 +00:00
deploymentinfo.h deploymentinfo: Add DeploymentName() 2021-06-30 08:19:12 +10:00
deploymentstatus.cpp consensus/params: simplify ValidDeployment check to avoid gcc warning 2022-08-01 15:35:06 -07:00
deploymentstatus.h Use DeploymentEnabled to hide VB deployments 2021-07-01 20:20:52 +02:00
dummywallet.cpp tests: Skip SQLite fsyncs while testing 2021-04-12 19:29:03 -04:00
dynafed.cpp lint: fix non-pylint linter errors 2021-10-15 00:20:20 +00:00
dynafed.h
external_signer.cpp refactor: make ExternalSigner NetworkArg() and m_chain private 2021-06-16 10:48:58 +02:00
external_signer.h refactor: make ExternalSigner NetworkArg() and m_chain private 2021-06-16 10:48:58 +02:00
flatfile.cpp log: Move "Pre-allocating up to position 0x[...] in [...].dat" log message to debug category 2021-02-10 20:46:25 +00:00
flatfile.h
fs.cpp refactor: include a missing <limits> header in fs.cpp 2022-12-07 11:11:30 +00:00
fs.h Replace fs::absolute calls with AbsPathJoin calls 2021-01-15 22:48:15 +01:00
hash.cpp Use C++17 [[fallthrough]] attribute, and drop -Wno-implicit-fallthrough 2021-07-05 08:59:38 +03:00
hash.h Squashed 'src/secp256k1/' changes from 90580edcc9..7a30cb0c9d 2022-05-25 15:18:23 -07:00
httprpc.cpp Drop JSONRPCRequest constructors after #21366 2021-04-07 04:53:26 -04:00
httprpc.h refactor: replace util::Ref by std::any (C++17) 2021-03-29 23:29:42 +02:00
httpserver.cpp Prevent data race for pathHandlers 2022-12-07 20:13:57 +00:00
httpserver.h
i2p.cpp net: do not connect to I2P hosts on port!=0 2021-07-09 11:19:37 +02:00
i2p.h i2p: use pointers to Sock to accommodate mocking 2021-03-16 13:59:18 +01:00
indirectmap.h
init.cpp Fix (inverse) meaning of -persistmempool 2022-12-07 11:11:30 +00:00
init.h init: remove straggling boost thread_group code 2021-07-12 21:46:59 +08:00
issuance.cpp
issuance.h
key.cpp ci: Update for libsecp256k1-zkp API changes 2022-05-25 16:12:00 -07:00
key.h Merge 5c2e2afe99 into merged_master (Bitcoin PR bitcoin/bitcoin#21365) 2021-08-03 20:43:53 +00:00
key_io.cpp Preserve blinding key when parsing taproot address. 2022-10-11 15:30:04 -07:00
key_io.h Better error messages for invalid addresses 2021-08-17 22:32:47 +00:00
logging.cpp multiprocess: Add Ipc interface implementation 2021-04-23 03:02:50 -05:00
logging.h multiprocess: Add Ipc interface implementation 2021-04-23 03:02:50 -05:00
mainchainrpc.cpp Make error messages when talking to parent chain daemon more useful. 2021-10-13 02:22:52 -07:00
mainchainrpc.h
Makefile.am Fix dependency of common on assetdir 2022-04-21 17:18:01 -07:00
Makefile.bench.include bench: add peer eviction protection benchmarks 2021-07-08 12:28:23 +02:00
Makefile.crc32c.include build: Update crc32c subtree 2020-12-08 19:26:30 +01:00
Makefile.leveldb.include Use C++17 [[fallthrough]] attribute, and drop -Wno-implicit-fallthrough 2021-07-05 08:59:38 +03:00
Makefile.qt.include ci: change a couple bitcoins to elementss 2021-10-14 23:55:17 +00:00
Makefile.qt_locale.include qt: Pre-rc2 translations update 2022-08-01 15:36:16 -07:00
Makefile.qttest.include Merge cf11f9c22f into merged_master (Bitcoin PR #21531) 2021-06-28 18:24:18 +00:00
Makefile.test.include Merge feee029d29 into merged_master (Elements PR ElementsProject/elements#1020) 2021-09-05 13:42:34 +00:00
Makefile.test_fuzz.include build: compile libnatpmp with -DNATPMP_STATICLIB on Windows 2021-03-04 12:34:46 +08:00
Makefile.test_util.include fuzz: [refactor] Use IsValidFlagCombination in signature_checker fuzz target 2021-03-30 10:42:45 +02:00
mapport.cpp refactor: Use appropriate thread constructor 2021-04-29 18:39:01 +03:00
mapport.h net: Add -natpmp command line option 2021-01-07 18:07:09 +02:00
memusage.h
merkleblock.cpp doc: fix various typos 2021-01-04 12:31:31 +08:00
merkleblock.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
miner.cpp feat: change getnewblockhex to take multiple commitments 2022-09-07 14:43:10 +02:00
miner.h feat: change getnewblockhex to take multiple commitments 2022-09-07 14:43:10 +02:00
net.cpp Merge bitcoin/bitcoin#22096: p2p: AddrFetch - don't disconnect on self-announcements 2021-07-20 20:27:21 +08:00
net.h Merge 2dda79cf61 into merged_master (Elements PR ElementsProject/elements#1094) 2022-04-21 15:54:34 -07:00
net_permissions.cpp p2p: pass strings to NetPermissions::TryParse functions by const ref 2021-05-19 19:41:05 +02:00
net_permissions.h Rate limit the processing of incoming addr messages 2021-07-15 12:52:38 -07:00
net_processing.cpp Merge 24ab49d110 into merged_master (Elements PR ElementsProject/elements#1085) 2022-04-21 15:36:43 -07:00
net_processing.h Add logging and addr rate limiting statistics 2021-07-15 13:03:20 -07:00
net_types.h
netaddress.cpp Merge bitcoin/bitcoin#22179: Torv2 removal followups 2021-07-08 17:20:35 +02:00
netaddress.h Merge bitcoin/bitcoin#22211: net: relay I2P addresses even if not reachable (by us) 2021-07-15 16:53:34 +02:00
netbase.cpp Merge #21387: p2p: Refactor sock to add I2P fuzz and unit tests 2021-03-30 17:41:13 +02:00
netbase.h doc: fixup -Wdocumentation issues 2021-04-06 14:50:17 +08:00
netmessagemaker.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
noui.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
noui.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
outputtype.cpp Merge 0553d75268 into merged_master (Bitcoin PR bitcoin/bitcoin#22154) 2021-07-29 02:50:04 +00:00
outputtype.h Disallow bech32m addresses for legacy wallet things 2021-06-22 21:57:04 -04:00
pegins.cpp Merge fec996403a into merged_master (Elements PR ElementsProject/elements#1072) 2022-04-20 19:29:07 -07:00
pegins.h Merge 250c8e59d5 into merged_master (Elements PR ElementsProject/elements#1030) 2021-09-18 03:17:06 +00:00
pow.cpp
pow.h
prevector.h
protocol.cpp Merge b34bf2b42c into merged_master (Bitcoin PR bitcoin/bitcoin#21939) 2021-07-10 05:28:53 +00:00
protocol.h Merge 7b45c5e875 into merged_master (Bitcoin PR bitcoin/bitcoin#20516) 2021-07-27 04:38:45 +00:00
psbt.cpp removing code to blind issuances. PSET should be modified to include an option to blind or unblind issuances, defaulting to unblind. 2022-08-24 09:42:29 -05:00
psbt.h psbt: Fix check for missing asset and its proof 2022-09-06 15:57:21 -04:00
pubkey.cpp Merge feee029d29 into merged_master (Elements PR ElementsProject/elements#1020) 2021-09-05 13:42:34 +00:00
pubkey.h Merge feee029d29 into merged_master (Elements PR ElementsProject/elements#1020) 2021-09-05 13:42:34 +00:00
random.cpp refactor: Replace &foo[0] with foo.data() 2021-05-04 06:55:31 +02:00
random.h
randomenv.cpp rand: only try and use freeifaddrs if available 2021-03-29 11:08:29 +08:00
randomenv.h
rest.cpp Merge 6baabc4d1d into merged_master (Bitcoin PR bitcoin/bitcoin#21430) 2021-08-02 20:39:15 +00:00
reverse_iterator.h
scheduler.cpp test: Fix off-by-one in mockscheduler test RPC 2021-05-14 12:49:16 +02:00
scheduler.h refactor: remove boost::thread_group usage 2021-01-29 15:39:44 +08:00
serialize.h Merge 9a154599fe into merged_master (Elements PR ElementsProject/elements#900) 2021-09-04 19:34:14 +00:00
shutdown.cpp move-only: Move AbortNode to shutdown 2021-04-04 18:08:36 +02:00
shutdown.h move-only: Move AbortNode to shutdown 2021-04-04 18:08:36 +02:00
signet.cpp Merge bd65a76b9d into merged_master (Bitcoin PR #21330) 2021-06-30 01:43:54 +00:00
signet.h scripted-diff: remove Optional & nullopt 2021-03-15 10:41:30 +08:00
span.h Merge #19387: span: update constructors to match c++20 draft spec and add lifetimebound attribute 2020-11-25 15:18:33 +01:00
streams.h Merge 2c0fc856a6 into merged_master (Bitcoin PR #20464) 2021-06-20 19:00:02 +00:00
sync.cpp refactor: remove straggling boost::mutex usage 2021-01-26 15:57:28 +08:00
sync.h refactor: Remove negative lock annotations from globals 2021-04-05 08:42:15 +02:00
threadinterrupt.cpp
threadinterrupt.h
threadsafety.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
timedata.cpp
timedata.h
tinyformat.h Use C++17 [[fallthrough]] attribute, and drop -Wno-implicit-fallthrough 2021-07-05 08:59:38 +03:00
torcontrol.cpp scripted-diff: Replace GetDataDir() calls with gArgs.GetDataDirNet() calls 2021-05-24 10:29:58 +02:00
torcontrol.h tests: Add fuzzing harness for TorController 2021-03-02 12:21:32 +00:00
txdb.cpp Merge 250c8e59d5 into merged_master (Elements PR ElementsProject/elements#1030) 2021-09-18 03:17:06 +00:00
txdb.h Merge 250c8e59d5 into merged_master (Elements PR ElementsProject/elements#1030) 2021-09-18 03:17:06 +00:00
txmempool.cpp Merge a55904a80c into merged_master (Bitcoin PR bitcoin/bitcoin#21866) 2021-07-29 13:18:11 +00:00
txmempool.h Merge ef8f2966ac into merged_master (Bitcoin PR bitcoin/bitcoin#22084) 2021-07-24 01:43:31 +00:00
txorphanage.cpp scripted-diff: Update txorphanage naming convention 2021-02-27 01:08:09 +10:00
txorphanage.h doc: Fix typos from codespell lint 2021-04-07 19:26:25 +01:00
txrequest.cpp doc: Fix typos from codespell lint 2021-04-07 19:26:25 +01:00
txrequest.h
uint256.cpp Merge 1ba24fe9b3 into merged_master (Elements PR ElementsProject/elements#1002) 2021-09-04 22:14:42 +00:00
uint256.h Merge 1ba24fe9b3 into merged_master (Elements PR ElementsProject/elements#1002) 2021-09-04 22:14:42 +00:00
undo.h
validation.cpp Fix (inverse) meaning of -persistmempool 2022-12-07 11:11:30 +00:00
validation.h Merge b707a6f00f into merged_master (Elements PR ElementsProject/elements#1069) 2022-04-20 20:51:37 -07:00
validationinterface.cpp
validationinterface.h
version.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
versionbits.cpp Restore changes to ComputeBlockVersion from #1062 and #1075, mistakenly dropped in merging. 2022-06-27 13:36:12 -07:00
versionbits.h Merge ddc6979b8b into merged_master (Bitcoin PR bitcoin/bitcoin#19438) 2021-07-30 16:16:50 +00:00
walletinitinterface.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
warnings.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
warnings.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00