]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
test/sslapitest.c: tfix in row allocation in create_new_vfile
authorEugene Syromiatnikov <esyr@openssl.org>
Tue, 12 Aug 2025 07:28:00 +0000 (09:28 +0200)
committerNeil Horman <nhorman@openssl.org>
Tue, 19 Aug 2025 18:47:54 +0000 (14:47 -0400)
sizeof(*row) and not sizeof(row) is supposed to be used for the array
allocation.

Fixes: 76fd7a1d6192 "Add a test for SRP"
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1662054
Related: https://github.com/openssl/project/issues/1317
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28238)

test/sslapitest.c

index fc574519a87e3eaecbcec5aa98f8ee09f90acaa4..673e7969aade3d6d43300793d627c1d6f398e74f 100644 (file)
@@ -7969,7 +7969,7 @@ static int ssl_srp_cb(SSL *s, int *ad, void *arg)
 static int create_new_vfile(char *userid, char *password, const char *filename)
 {
     char *gNid = NULL;
-    OPENSSL_STRING *row = OPENSSL_calloc(DB_NUMBER + 1, sizeof(row));
+    OPENSSL_STRING *row = OPENSSL_calloc(DB_NUMBER + 1, sizeof(*row));
     TXT_DB *db = NULL;
     int ret = 0;
     BIO *out = NULL, *dummy = BIO_new_mem_buf("", 0);