Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Nov 2024 20:12:48 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: be20e3fd93c4 - stable/13 - bsdinstall: Consistently use item count as the first argument to calloc
Message-ID:  <202411302012.4AUKCmV0026697@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=be20e3fd93c43009b389555bcc4261de309cfab3

commit be20e3fd93c43009b389555bcc4261de309cfab3
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-11-30 19:53:30 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-11-30 19:53:30 +0000

    bsdinstall: Consistently use item count as the first argument to calloc
    
    This is a direct commit to stable/13.
    
    Reported by:    GCC 14 -Wcalloc-transposed-args
---
 usr.sbin/bsdinstall/distfetch/distfetch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/bsdinstall/distfetch/distfetch.c b/usr.sbin/bsdinstall/distfetch/distfetch.c
index fb8d2cc048ad..9bbaf6a2f137 100644
--- a/usr.sbin/bsdinstall/distfetch/distfetch.c
+++ b/usr.sbin/bsdinstall/distfetch/distfetch.c
@@ -117,7 +117,7 @@ fetch_files(int nfiles, char **urls)
 	uint8_t block[4096];
 
 	/* Make the transfer list for dialog */
-	items = calloc(sizeof(char *), nfiles * 2);
+	items = calloc(nfiles * 2, sizeof(char *));
 	if (items == NULL)
 		errx(EXIT_FAILURE, "Out of memory!");
 



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