diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2019-11-18 15:26:55 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2019-12-05 16:31:09 -0800 |
commit | 5909bcd3bf3c3502355e89fd0b76bb8e93d8a95b (patch) | |
tree | 388569d03abf646a5b616c7a68e4611d0f2cf0a3 /src/base58.h | |
parent | 2bcf1fc444d5c4b8efa879e54e7b6134b7e6b986 (diff) |
Add bounds checks in key_io before DecodeBase58Check
Diffstat (limited to 'src/base58.h')
-rw-r--r-- | src/base58.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/base58.h b/src/base58.h index cfdab511b6..90eded4992 100644 --- a/src/base58.h +++ b/src/base58.h @@ -16,7 +16,6 @@ #include <attributes.h> -#include <limits> #include <string> #include <vector> @@ -36,13 +35,13 @@ std::string EncodeBase58(const std::vector<unsigned char>& vch); * return true if decoding is successful. * psz cannot be nullptr. */ -NODISCARD bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet, int max_ret_len = std::numeric_limits<int>::max()); +NODISCARD bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet, int max_ret_len); /** * Decode a base58-encoded string (str) into a byte vector (vchRet). * return true if decoding is successful. */ -NODISCARD bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet, int max_ret_len = std::numeric_limits<int>::max()); +NODISCARD bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet, int max_ret_len); /** * Encode a byte vector into a base58-encoded string, including checksum @@ -53,12 +52,12 @@ std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn); * Decode a base58-encoded string (psz) that includes a checksum into a byte * vector (vchRet), return true if decoding is successful */ -NODISCARD bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet, int max_ret_len = std::numeric_limits<int>::max()); +NODISCARD bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet, int max_ret_len); /** * Decode a base58-encoded string (str) that includes a checksum into a byte * vector (vchRet), return true if decoding is successful */ -NODISCARD bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet, int max_ret_len = std::numeric_limits<int>::max()); +NODISCARD bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet, int max_ret_len); #endif // BITCOIN_BASE58_H |