don't memset(data,0,...) if data is NULL
authorBodo Möller <bodo@openssl.org>
Thu, 29 Aug 2002 11:33:43 +0000 (11:33 +0000)
committerBodo Möller <bodo@openssl.org>
Thu, 29 Aug 2002 11:33:43 +0000 (11:33 +0000)
Submitted by: anonymous
PR: 254

crypto/pem/pem_lib.c

index 01759f75c3b548135055602b777ec57dd3b6bc21..043b578e22d9ab8e90d6c05e2e7387a897cdf1c2 100644 (file)
@@ -405,8 +405,11 @@ err:
        memset(iv,0,sizeof(iv));
        memset((char *)&ctx,0,sizeof(ctx));
        memset(buf,0,PEM_BUFSIZE);
-       memset(data,0,(unsigned int)dsize);
-       OPENSSL_free(data);
+       if (data != NULL)
+               {
+               memset(data,0,(unsigned int)dsize);
+               OPENSSL_free(data);
+               }
        return(ret);
        }