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