aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-03-30 23:35:51 +0000
committerlloyd <[email protected]>2014-03-30 23:35:51 +0000
commit763dd827af5c1a481963316ab602141723432e49 (patch)
treefe130433c4aa22118a1695a01d806c0372e46de1
parente5bf2f0b5c177c4bea8983b552106e90efb79083 (diff)
Avoid a ubsan warning on GCC 4.9 due uninitialized sign enum being
read during swap (in the move constructor)
-rw-r--r--src/lib/math/bigint/bigint.cpp4
-rw-r--r--src/lib/math/bigint/bigint.h2
2 files changed, 1 insertions, 5 deletions
diff --git a/src/lib/math/bigint/bigint.cpp b/src/lib/math/bigint/bigint.cpp
index 45c351256..059b019e4 100644
--- a/src/lib/math/bigint/bigint.cpp
+++ b/src/lib/math/bigint/bigint.cpp
@@ -18,8 +18,6 @@ namespace Botan {
*/
BigInt::BigInt(u64bit n)
{
- set_sign(Positive);
-
if(n == 0)
return;
@@ -82,7 +80,6 @@ BigInt::BigInt(const std::string& str)
*/
BigInt::BigInt(const byte input[], size_t length, Base base)
{
- set_sign(Positive);
*this = decode(input, length, base);
}
@@ -91,7 +88,6 @@ BigInt::BigInt(const byte input[], size_t length, Base base)
*/
BigInt::BigInt(RandomNumberGenerator& rng, size_t bits)
{
- set_sign(Positive);
randomize(rng, bits);
}
diff --git a/src/lib/math/bigint/bigint.h b/src/lib/math/bigint/bigint.h
index 08b7d53fc..a1164bf92 100644
--- a/src/lib/math/bigint/bigint.h
+++ b/src/lib/math/bigint/bigint.h
@@ -518,7 +518,7 @@ class BOTAN_DLL BigInt
private:
secure_vector<word> m_reg;
- Sign m_signedness;
+ Sign m_signedness = Positive;
};
/*