Bugzilla – Bug 1221694
GCC 14: pesign package fails
Last modified: 2024-03-20 08:54:54 UTC
Building pesign with GCC 14 fails here: https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:Gcc7/pesign/standard/x86_64 Due to: pesigcheck.c: In function ‘check_signature’: pesigcheck.c:243:34: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] 243 | reasonps = calloc(sizeof(struct reason), 512); | ^~~~~~ pesigcheck.c:243:34: note: earlier argument should specify number of elements, later size of each element pesigcheck.c:284:53: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] 284 | new_reasons = calloc(sizeof(struct reason), num_reasons); | ^~~~~~ pesigcheck.c:284:53: note: earlier argument should specify number of elements, later size of each element Builds with automatically generated: Index: pesign-116/src/pesigcheck.c =================================================================== --- pesign-116.orig/src/pesigcheck.c +++ pesign-116/src/pesigcheck.c @@ -240,7 +240,7 @@ check_signature(pesigcheck_context *ctx, cert_iter iter; - reasonps = calloc(sizeof(struct reason), 512); + reasonps = calloc(512, sizeof(struct reason)); if (!reasonps) err(1, "check_signature"); @@ -281,7 +281,7 @@ check_signature(pesigcheck_context *ctx, num_reasons += 16; - new_reasons = calloc(sizeof(struct reason), num_reasons); + new_reasons = calloc(num_reasons, sizeof(struct reason)); if (!new_reasons) err(1, "check_signature"); reasonps = new_reasons;
Upstream fix: https://github.com/rhboot/pesign/commit/1f9e2fa0b4d872fdd01ca3ba81b04dfb1211a187
Fixed with sr#1159787