Skip to content

Commit 9c1e83b

Browse files
committed
fix XCALLOC() against GCC 14 -Wcalloc-transposed-args
Fix use of XCALLOC() macro against GCC 14 directive -Wcalloc-transposed-args that makes GCC to complain with an warning/error trace message like the below when 1st argument is given by sizeof(). warning: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args] No functional changes. Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
1 parent f7e6519 commit 9c1e83b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/pk/asn1/der/sequence/der_decode_sequence_flexi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ static int s_der_decode_sequence_flexi(const unsigned char *in, unsigned long *i
268268
}
269269
l->size = len;
270270

271-
if ((l->data = XCALLOC(sizeof(wchar_t), l->size)) == NULL) {
271+
if ((l->data = XCALLOC(l->size, sizeof(wchar_t))) == NULL) {
272272
err = CRYPT_MEM;
273273
goto error;
274274
}

src/pk/asn1/der/sequence/der_decode_sequence_multi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static int s_der_decode_sequence_va(const unsigned char *in, unsigned long inlen
7777
return CRYPT_NOP;
7878
}
7979

80-
list = XCALLOC(sizeof(*list), x);
80+
list = XCALLOC(x, sizeof(*list));
8181
if (list == NULL) {
8282
return CRYPT_MEM;
8383
}

src/pk/asn1/der/sequence/der_encode_sequence_multi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...)
8080
return CRYPT_NOP;
8181
}
8282

83-
list = XCALLOC(sizeof(*list), x);
83+
list = XCALLOC(x, sizeof(*list));
8484
if (list == NULL) {
8585
return CRYPT_MEM;
8686
}

0 commit comments

Comments
 (0)