summaryrefslogtreecommitdiffstats
path: root/src/lib/cryptolink
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2018-06-07 16:51:51 +0200
committerFrancis Dupont <fdupont@isc.org>2018-06-07 16:51:51 +0200
commit4dfd330a242e5dd677b26b497271ed7c13198330 (patch)
tree2329ee6ce8d7c66c35d9d099ed8340c8cadc10a2 /src/lib/cryptolink
parent[master] Added ChangeLog for #5622. (diff)
parent[5449] Removed explicit throws() in data.h (diff)
downloadkea-4dfd330a242e5dd677b26b497271ed7c13198330.tar.xz
kea-4dfd330a242e5dd677b26b497271ed7c13198330.zip
[master] Finishing merge of trac5449 (Fixes from analyzers)
Diffstat (limited to 'src/lib/cryptolink')
-rw-r--r--src/lib/cryptolink/openssl_common.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/cryptolink/openssl_common.h b/src/lib/cryptolink/openssl_common.h
index 403a59d3b2..7e47e698f5 100644
--- a/src/lib/cryptolink/openssl_common.h
+++ b/src/lib/cryptolink/openssl_common.h
@@ -37,6 +37,12 @@ public:
SecBuf(const std::vector<T>& x) : vec_(x) {}
~SecBuf() {
+#if defined(__has_feature)
+#if __has_feature(address_sanitizer)
+ // Make the address sanitizer happy assuming this won't reallocate
+ vec_.resize(vec_.capacity());
+#endif
+#endif
std::memset(&vec_[0], 0, vec_.capacity() * sizeof(T));
};
@@ -65,6 +71,12 @@ public:
};
void clear() {
+#if defined(__has_feature)
+#if __has_feature(address_sanitizer)
+ // Make the address sanitizer happy assuming this won't reallocate
+ vec_.resize(vec_.capacity());
+#endif
+#endif
std::memset(&vec_[0], 0, vec_.capacity() * sizeof(T));
vec_.clear();
}