aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/mem_clr.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/mem_clr.c')
-rw-r--r--crypto/mem_clr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/mem_clr.c b/crypto/mem_clr.c
index 3df1f3928d06..1a06636d0ce8 100644
--- a/crypto/mem_clr.c
+++ b/crypto/mem_clr.c
@@ -66,6 +66,10 @@ void OPENSSL_cleanse(void *ptr, size_t len)
{
unsigned char *p = ptr;
size_t loop = len, ctr = cleanse_ctr;
+
+ if (ptr == NULL)
+ return;
+
while (loop--) {
*(p++) = (unsigned char)ctr;
ctr += (17 + ((size_t)p & 0xF));