mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
Merge bitcoin/bitcoin#34074: A few followups after introducing /rest/blockpart/ endpoint
59b93f11e8rest: print also HTTP response reason in case of an error (Roman Zeyde)7fe94a0493rest: add a test for unsuported `/blockpart/` request type (Roman Zeyde)55d0d19b5crest: deduplicate `interface_rest.py` negative tests (Roman Zeyde)89eb531024rest: update release notes for `/blockpart/` endpoint (Roman Zeyde)41118e17f8blockstorage: simplify partial block read validation (Roman Zeyde)599effdeabrest: reformat `uri_prefixes` initializer list (Roman Zeyde) Pull request description: The commits below should resolve a few leftovers from #33657. ACKs for top commit: l0rinc: ACK59b93f11e8hodlinator: re-ACK59b93f11e8Tree-SHA512: ae45e08edd315018e11283b354fb32f9658f5829c956554dc662a81c2e16397def7c3700e6354e0a91ff03c850def35638a69ec2668b7c015d25d6fed42b92bb
This commit is contained in:
@@ -1091,7 +1091,7 @@ BlockManager::ReadRawBlockResult BlockManager::ReadRawBlock(const FlatFilePos& p
|
||||
|
||||
if (block_part) {
|
||||
const auto [offset, size]{*block_part};
|
||||
if (size == 0 || offset >= blk_size || size > blk_size - offset) {
|
||||
if (size == 0 || SaturatingAdd(offset, size) > blk_size) {
|
||||
return util::Unexpected{ReadRawError::BadPartRange}; // Avoid logging - offset/size come from untrusted REST input
|
||||
}
|
||||
filein.seek(offset, SEEK_CUR);
|
||||
|
||||
Reference in New Issue
Block a user