From: Eugene Syromiatnikov Date: Tue, 12 Aug 2025 07:28:00 +0000 (+0200) Subject: test/sslapitest.c: tfix in row allocation in create_new_vfile X-Git-Tag: openssl-3.6.0-alpha1~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abebeb1bb008452f9d0524509627d015dc69fbd1;p=thirdparty%2Fopenssl.git test/sslapitest.c: tfix in row allocation in create_new_vfile 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 Reviewed-by: Tomas Mraz Reviewed-by: Shane Lontis Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/28238) --- diff --git a/test/sslapitest.c b/test/sslapitest.c index fc574519a87..673e7969aad 100644 --- a/test/sslapitest.c +++ b/test/sslapitest.c @@ -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);