forked from wolfSSL/wolfssl
Merge pull request #8711 from JacobBarthelmeh/coverity
fix for sanity check on --group with unit test app and null sanity check with des decrypt
This commit is contained in:
@@ -346,6 +346,7 @@ static int test_provide_quic_data(void) {
|
|||||||
len = fake_record(1, 100, lbuffer);
|
len = fake_record(1, 100, lbuffer);
|
||||||
ExpectTrue(provide_data(ssl, wolfssl_encryption_initial, lbuffer, len, 1));
|
ExpectTrue(provide_data(ssl, wolfssl_encryption_initial, lbuffer, len, 1));
|
||||||
wolfSSL_free(ssl);
|
wolfSSL_free(ssl);
|
||||||
|
ssl = NULL;
|
||||||
|
|
||||||
ExpectNotNull(ssl = wolfSSL_new(ctx));
|
ExpectNotNull(ssl = wolfSSL_new(ctx));
|
||||||
len = fake_record(1, 100, lbuffer);
|
len = fake_record(1, 100, lbuffer);
|
||||||
|
@@ -209,7 +209,7 @@ int unit_test(int argc, char** argv)
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
else if (XSTRCMP(argv[1], "--group") == 0) {
|
else if (XSTRCMP(argv[1], "--group") == 0) {
|
||||||
if (argc == 1) {
|
if (argc == 2) {
|
||||||
fprintf(stderr, "No group name supplied\n");
|
fprintf(stderr, "No group name supplied\n");
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto exit;
|
goto exit;
|
||||||
|
@@ -1742,6 +1742,10 @@
|
|||||||
{
|
{
|
||||||
word32 blocks = sz / DES_BLOCK_SIZE;
|
word32 blocks = sz / DES_BLOCK_SIZE;
|
||||||
|
|
||||||
|
if (des == NULL || out == NULL || in == NULL) {
|
||||||
|
return BAD_FUNC_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
while (blocks--) {
|
while (blocks--) {
|
||||||
XMEMCPY(des->tmp, in, DES_BLOCK_SIZE);
|
XMEMCPY(des->tmp, in, DES_BLOCK_SIZE);
|
||||||
DesProcessBlock(des, (byte*)des->tmp, out);
|
DesProcessBlock(des, (byte*)des->tmp, out);
|
||||||
|
Reference in New Issue
Block a user