forked from bitcoin/bitcoin
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- rpc/wallet: initialize nFeeRequired to avoid using garbage value on failure bitcoin#18274 - httpserver: use own HTTP status codes bitcoin#18168 - tests: Add fuzzing harnesses for various Base{32,58,64} and hex related functions bitcoin#17229 - util: Don't allow Base32/64-decoding or ParseMoney(…) on strings with embedded NUL characters. Add tests. bitcoin#17753 - util: Fail to parse empty string in ParseMoney bitcoin#18225 - util: Fail to parse whitespace-only strings in ParseMoney(...) (instead of parsing as zero) bitcoin#18270 - Replace the LogPrint function with a macro bitcoin#17218 - Fix wallet unload race condition bitcoin#18338 - qt: Fix Window -> Minimize menu item bitcoin#18549 - windows: Enable heap terminate-on-corruption bitcoin#17916
- Loading branch information
Showing
27 changed files
with
268 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (c) 2019 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#include <test/fuzz/fuzz.h> | ||
|
||
#include <base58.h> | ||
#include <util/string.h> | ||
#include <util/strencodings.h> | ||
|
||
#include <cassert> | ||
#include <cstdint> | ||
#include <string> | ||
#include <vector> | ||
|
||
void test_one_input(const std::vector<uint8_t>& buffer) | ||
{ | ||
const std::string random_encoded_string(buffer.begin(), buffer.end()); | ||
|
||
std::vector<unsigned char> decoded; | ||
if (DecodeBase58(random_encoded_string, decoded, 100)) { | ||
const std::string encoded_string = EncodeBase58(decoded); | ||
assert(encoded_string == TrimString(encoded_string)); | ||
assert(ToLower(encoded_string) == ToLower(TrimString(random_encoded_string))); | ||
} | ||
|
||
if (DecodeBase58Check(random_encoded_string, decoded, 100)) { | ||
const std::string encoded_string = EncodeBase58Check(decoded); | ||
assert(encoded_string == TrimString(encoded_string)); | ||
assert(ToLower(encoded_string) == ToLower(TrimString(random_encoded_string))); | ||
} | ||
|
||
bool pf_invalid; | ||
std::string decoded_string = DecodeBase32(random_encoded_string, &pf_invalid); | ||
if (!pf_invalid) { | ||
const std::string encoded_string = EncodeBase32(decoded_string); | ||
assert(encoded_string == TrimString(encoded_string)); | ||
assert(ToLower(encoded_string) == ToLower(TrimString(random_encoded_string))); | ||
} | ||
|
||
decoded_string = DecodeBase64(random_encoded_string, &pf_invalid); | ||
if (!pf_invalid) { | ||
const std::string encoded_string = EncodeBase64(decoded_string); | ||
assert(encoded_string == TrimString(encoded_string)); | ||
assert(ToLower(encoded_string) == ToLower(TrimString(random_encoded_string))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) 2019 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#include <test/fuzz/fuzz.h> | ||
|
||
#include <util/strencodings.h> | ||
|
||
#include <cassert> | ||
#include <cstdint> | ||
#include <string> | ||
#include <vector> | ||
|
||
void test_one_input(const std::vector<uint8_t>& buffer) | ||
{ | ||
const std::string random_hex_string(buffer.begin(), buffer.end()); | ||
const std::vector<unsigned char> data = ParseHex(random_hex_string); | ||
const std::string hex_data = HexStr(data); | ||
if (IsHex(random_hex_string)) { | ||
assert(ToLower(random_hex_string) == hex_data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.