diff options
author | MarcoFalke <falke.marco@gmail.com> | 2022-02-21 09:27:09 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2022-02-25 09:43:54 +0100 |
commit | aaaa4dbab4ec06d69645de919810ccd0da836a0e (patch) | |
tree | ce7cc9670d6009063845aee61cc7f41f640d1ecb | |
parent | fae6b26758fff0dd52a9f4f37bb8325907a48589 (diff) |
Avoid implicit-integer-sign-change in bech32.cpp
-rw-r--r-- | src/bech32.cpp | 5 | ||||
-rw-r--r-- | test/sanitizer_suppressions/ubsan | 1 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/bech32.cpp b/src/bech32.cpp index 3cda1dfff5..dce9b2e4cc 100644 --- a/src/bech32.cpp +++ b/src/bech32.cpp @@ -284,10 +284,11 @@ inline unsigned char LowerCase(unsigned char c) } /** Return indices of invalid characters in a Bech32 string. */ -bool CheckCharacters(const std::string& str, std::vector<int>& errors) { +bool CheckCharacters(const std::string& str, std::vector<int>& errors) +{ bool lower = false, upper = false; for (size_t i = 0; i < str.size(); ++i) { - unsigned char c = str[i]; + unsigned char c{(unsigned char)(str[i])}; if (c >= 'a' && c <= 'z') { if (upper) { errors.push_back(i); diff --git a/test/sanitizer_suppressions/ubsan b/test/sanitizer_suppressions/ubsan index 9f3a700830..b06dd253be 100644 --- a/test/sanitizer_suppressions/ubsan +++ b/test/sanitizer_suppressions/ubsan @@ -53,7 +53,6 @@ unsigned-integer-overflow:policy/fees.cpp unsigned-integer-overflow:prevector.h unsigned-integer-overflow:script/interpreter.cpp unsigned-integer-overflow:txmempool.cpp -implicit-integer-sign-change:bech32.cpp implicit-integer-sign-change:compat/stdin.cpp implicit-integer-sign-change:compressor.h implicit-integer-sign-change:crypto/ |