summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/replace/replace.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index da5526c4a2f..bd7f6e53e81 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -865,6 +865,17 @@ typedef unsigned long long ptrdiff_t ;
#define BURN_PTR_SIZE(x, s) memset_s((x), (s), 0, (s))
/**
+ * Explicitly zero data in string. This is guaranteed to be not optimized
+ * away.
+ */
+#define BURN_STR(x) do { \
+ if ((x) != NULL) { \
+ size_t s = strlen(x); \
+ memset_s((x), s, 0, s); \
+ } \
+ } while(0)
+
+/**
* Work out how many elements there are in a static array.
*/
#ifdef ARRAY_SIZE