Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Nov 2024 16:51:39 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 73b0985e68e5 - stable/13 - lib80211: Consistently use item count as the first argument to calloc
Message-ID:  <202411301651.4AUGpd68050563@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=73b0985e68e554719cb40ba026418c80ae8740e0

commit 73b0985e68e554719cb40ba026418c80ae8740e0
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-07-19 17:03:19 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-11-29 19:26:09 +0000

    lib80211: Consistently use item count as the first argument to calloc
    
    Reported by:    GCC 14 -Wcalloc-transposed-args
    Reviewed by:    rlibby, emaste
    Differential Revision:  https://reviews.freebsd.org/D46008
    
    (cherry picked from commit 8aadd10a65b11f18950118a10569233e1420ab45)
---
 lib/lib80211/lib80211_regdomain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/lib80211/lib80211_regdomain.c b/lib/lib80211/lib80211_regdomain.c
index 189d4661c78b..db353a69f4d9 100644
--- a/lib/lib80211/lib80211_regdomain.c
+++ b/lib/lib80211/lib80211_regdomain.c
@@ -441,7 +441,7 @@ lib80211_regdomain_readconfig(struct regdata *rdp, const void *p, size_t len)
 	XML_ParserFree(mt->parser);
 
 	/* setup the identifer table */
-	rdp->ident = calloc(sizeof(struct ident), mt->nident + 1);
+	rdp->ident = calloc(mt->nident + 1, sizeof(struct ident));
 	if (rdp->ident == NULL)
 		return ENOMEM;
 	free(mt);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202411301651.4AUGpd68050563>