git: 2cefae4cf34e - main - Fix transposed arguments in call to calloc(). Reported by GCC 15 warning.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 17 Aug 2026 19:17:39 UTC
The branch main has been updated by mckusick:
URL: https://cgit.FreeBSD.org/src/commit/?id=2cefae4cf34e7d39fc3b27358d7d66a96b3b0056
commit 2cefae4cf34e7d39fc3b27358d7d66a96b3b0056
Author: Kirk McKusick <mckusick@FreeBSD.org>
AuthorDate: 2026-08-17 19:15:09 +0000
Commit: Kirk McKusick <mckusick@FreeBSD.org>
CommitDate: 2026-08-17 19:15:09 +0000
Fix transposed arguments in call to calloc(). Reported by GCC 15 warning.
No functional change intended.
Submitted by: Pedro Giffuni <pfg@freebsd.org>
MFC-after: 1 week
---
sbin/restore/symtab.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sbin/restore/symtab.c b/sbin/restore/symtab.c
index 3ae6bf20c7be..840ff54b0428 100644
--- a/sbin/restore/symtab.c
+++ b/sbin/restore/symtab.c
@@ -545,7 +545,7 @@ initsymtable(char *filename)
panic("cannot stat symbol table file %s\n", filename);
}
tblsize = stbuf.st_size - sizeof(struct symtableheader);
- base = calloc(sizeof(char), (unsigned)tblsize);
+ base = calloc((size_t)tblsize, sizeof(char));
if (base == NULL)
panic("cannot allocate space for symbol table\n");
if (read(fd, base, (int)tblsize) < 0 ||