Skip to content

Commit 66de1d6

Browse files
committed
Fix wolfSSL_CRYPTO_memcmp
This is used by the OpenSSL compatibility layer. If either parameter was NULL, it would return as a match. We should return a non-match instead. OpenSSL itself has no safety checks here.
1 parent 3a1aa83 commit 66de1d6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15671,7 +15671,7 @@ int wolfSSL_CTX_set_servername_arg(WOLFSSL_CTX* ctx, void* arg)
1567115671
int wolfSSL_CRYPTO_memcmp(const void *a, const void *b, size_t size)
1567215672
{
1567315673
if (!a || !b)
15674-
return 0;
15674+
return -1;
1567515675
return ConstantCompare((const byte*)a, (const byte*)b, (int)size);
1567615676
}
1567715677

0 commit comments

Comments
 (0)