summaryrefslogtreecommitdiff
path: root/cryptlib.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2016-07-13 00:40:07 -0400
committerJeffrey Walton <noloader@gmail.com>2016-07-13 00:40:07 -0400
commit8281e51e9411f3198346140e21a006c5d5d4451e (patch)
treeaf9ff574e197ca6f09932ede1b1d9c68ba76f717 /cryptlib.cpp
parentb0b7b715628e8a90850100d5f185d6fbdcefdcdb (diff)
downloadcryptopp-git-8281e51e9411f3198346140e21a006c5d5d4451e.tar.gz
Cleared most "Conditional jump or move depends on uninitialised value" (Issue 223)
Diffstat (limited to 'cryptlib.cpp')
-rw-r--r--cryptlib.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/cryptlib.cpp b/cryptlib.cpp
index 4fa36538..943edc55 100644
--- a/cryptlib.cpp
+++ b/cryptlib.cpp
@@ -48,19 +48,20 @@ CRYPTOPP_COMPILE_ASSERT(sizeof(dword) == 2*sizeof(word));
#if HAVE_GCC_INIT_PRIORITY
CRYPTOPP_COMPILE_ASSERT(CRYPTOPP_INIT_PRIORITY >= 101);
-const std::string DEFAULT_CHANNEL __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 25)));
+const std::string DEFAULT_CHANNEL __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 25))) = "";
const std::string AAD_CHANNEL __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 26))) = "AAD";
const std::string &BufferedTransformation::NULL_CHANNEL = DEFAULT_CHANNEL;
#elif HAVE_MSC_INIT_PRIORITY
#pragma warning(disable: 4073)
#pragma init_seg(lib)
-const std::string DEFAULT_CHANNEL;
+const std::string DEFAULT_CHANNEL = "";
const std::string AAD_CHANNEL = "AAD";
const std::string &BufferedTransformation::NULL_CHANNEL = DEFAULT_CHANNEL;
#pragma warning(default: 4073)
#else
-const std::string DEFAULT_CHANNEL;
-const std::string AAD_CHANNEL = "AAD";
+static const std::string s1(""), s2("AAD");
+const std::string DEFAULT_CHANNEL = s1;
+const std::string AAD_CHANNEL = s2;
const std::string &BufferedTransformation::NULL_CHANNEL = DEFAULT_CHANNEL;
#endif