mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-12 10:44:58 +03:00
Fix potential NULL pointer dereference
This commit is contained in:
@ -351,6 +351,11 @@ MD *NewMdEx(char *name, bool hmac)
|
||||
#else
|
||||
m->Ctx = EVP_MD_CTX_create();
|
||||
#endif
|
||||
if (m->Ctx == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (EVP_DigestInit_ex(m->Ctx, m->Md, NULL) == false)
|
||||
{
|
||||
Debug("NewMdEx(): EVP_DigestInit_ex() failed with error: %s\n", OpenSSL_Error());
|
||||
@ -4604,6 +4609,11 @@ DH_CTX *DhNew(char *prime, UINT g)
|
||||
dh = ZeroMalloc(sizeof(DH_CTX));
|
||||
|
||||
dh->dh = DH_new();
|
||||
if (dh->dh == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
dhp = BinToBigNum(buf->Buf, buf->Size);
|
||||
dhg = BN_new();
|
||||
|
Reference in New Issue
Block a user