]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Address coverity reports
authorViktor Dukhovni <openssl-users@dukhovni.org>
Tue, 11 Feb 2025 10:45:23 +0000 (21:45 +1100)
committerNeil Horman <nhorman@openssl.org>
Wed, 12 Feb 2025 17:14:04 +0000 (12:14 -0500)
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26703)

ssl/t1_lib.c
test/tls13groupselection_test.c

index bf5c0ef444ad57b958e43ad42430067d1e090d57..0318cbc7260fce7c0d7451d12e0117835b0af8b3 100644 (file)
@@ -1580,11 +1580,9 @@ int tls1_set_groups_list(SSL_CTX *ctx,
         return 0;
     }
 
+    memset(&gcb, 0, sizeof(gcb));
     gcb.tuple_mode = 1; /* We prepare to collect the first tuple */
     gcb.ignore_unknown_default = 0;
-    gcb.gidcnt = 0;
-    gcb.ksidcnt = 0;
-    gcb.tplcnt = 0;
     gcb.gidmax = GROUPLIST_INCREMENT;
     gcb.tplmax = GROUPLIST_INCREMENT;
     gcb.ksidmax = GROUPLIST_INCREMENT;
index 47432eeecde1bed1b45185cd03d21e217ffab3a3..e3a25dba134f31e29cc50ed6d031605c839f3bf3 100644 (file)
@@ -367,8 +367,9 @@ static int test_invalidsyntax(const struct tls13groupselection_test_st *current_
     SSL_CTX *client_ctx = NULL, *server_ctx = NULL;
     SSL *clientssl = NULL, *serverssl = NULL;
 
-    TEST_ptr(current_test_vector->client_groups);
-    TEST_size_t_ne(strlen(current_test_vector->client_groups), 0);
+    if (!TEST_ptr(current_test_vector->client_groups)
+        || !TEST_size_t_ne(strlen(current_test_vector->client_groups), 0))
+        goto end;
 
     /* Creation of the contexts */
     TEST_true_or_end(create_ssl_ctx_pair(NULL, TLS_server_method(),
@@ -378,10 +379,9 @@ static int test_invalidsyntax(const struct tls13groupselection_test_st *current_
                                          cert, privkey));
 
     /* Customization of the contexts */
-    if (ssl_or_ctx == WORK_ON_CONTEXT) {
+    if (ssl_or_ctx == WORK_ON_CONTEXT)
         TEST_false_or_end(SSL_CTX_set1_groups_list(client_ctx,
                                                    current_test_vector->client_groups));
-    }
     /* Creation of the SSL objects */
     TEST_true_or_end(create_ssl_objects(server_ctx, client_ctx,
                                         &serverssl, &clientssl,