diff --git a/crypto/mem_clr.c b/crypto/mem_clr.c index 3df1f3928d..1a06636d0c 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));