From 39f18939562890d6b28060689f9fb309cebb238c Mon Sep 17 00:00:00 2001 From: Bhargava Shastry Date: Mon, 14 Dec 2020 11:20:31 +0100 Subject: [PATCH] Fix integer overflow due to large unsigned cpp_int --- test/tools/ossfuzz/protoToAbiV2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tools/ossfuzz/protoToAbiV2.cpp b/test/tools/ossfuzz/protoToAbiV2.cpp index 4e5b2081a19e..9ea528e1728b 100644 --- a/test/tools/ossfuzz/protoToAbiV2.cpp +++ b/test/tools/ossfuzz/protoToAbiV2.cpp @@ -69,7 +69,7 @@ static V integerValue(unsigned _counter) V value = V( u256(solidity::util::keccak256(solidity::util::h256(_counter))) % u256(boost::math::tools::max_value()) ); - if (value % 2 == 0) + if (boost::multiprecision::is_signed_number::value && value % 2 == 0) return value * (-1); else return value;