From fae6b26758fff0dd52a9f4f37bb8325907a48589 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 10 Feb 2022 17:08:46 +0100 Subject: [PATCH 1/2] test: Remove no longer needed suppressions --- test/sanitizer_suppressions/ubsan | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/sanitizer_suppressions/ubsan b/test/sanitizer_suppressions/ubsan index bdaee5d1912..9f3a700830f 100644 --- a/test/sanitizer_suppressions/ubsan +++ b/test/sanitizer_suppressions/ubsan @@ -51,15 +51,12 @@ unsigned-integer-overflow:crypto/ unsigned-integer-overflow:hash.cpp unsigned-integer-overflow:policy/fees.cpp unsigned-integer-overflow:prevector.h -unsigned-integer-overflow:pubkey.h unsigned-integer-overflow:script/interpreter.cpp unsigned-integer-overflow:txmempool.cpp -unsigned-integer-overflow:util/strencodings.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/ -implicit-integer-sign-change:key.cpp implicit-integer-sign-change:policy/fees.cpp implicit-integer-sign-change:prevector.h implicit-integer-sign-change:script/bitcoinconsensus.cpp From aaaa4dbab4ec06d69645de919810ccd0da836a0e Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 21 Feb 2022 09:27:09 +0100 Subject: [PATCH 2/2] Avoid implicit-integer-sign-change in bech32.cpp --- src/bech32.cpp | 5 +++-- test/sanitizer_suppressions/ubsan | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bech32.cpp b/src/bech32.cpp index 3cda1dfff5b..dce9b2e4cc3 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& errors) { +bool CheckCharacters(const std::string& str, std::vector& 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 9f3a700830f..b06dd253bef 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/