Skip to content

Commit

Permalink
Merge pull request #647 from etienne-lms/xcalloc
Browse files Browse the repository at this point in the history
fix XCALLOC() against GCC 14 -Wcalloc-transposed-args
  • Loading branch information
sjaeckel committed Jun 26, 2024
2 parents f7e6519 + 9c1e83b commit 2302a3a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/pk/asn1/der/sequence/der_decode_sequence_flexi.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ static int s_der_decode_sequence_flexi(const unsigned char *in, unsigned long *i
}
l->size = len;

if ((l->data = XCALLOC(sizeof(wchar_t), l->size)) == NULL) {
if ((l->data = XCALLOC(l->size, sizeof(wchar_t))) == NULL) {
err = CRYPT_MEM;
goto error;
}
Expand Down
2 changes: 1 addition & 1 deletion src/pk/asn1/der/sequence/der_decode_sequence_multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static int s_der_decode_sequence_va(const unsigned char *in, unsigned long inlen
return CRYPT_NOP;
}

list = XCALLOC(sizeof(*list), x);
list = XCALLOC(x, sizeof(*list));
if (list == NULL) {
return CRYPT_MEM;
}
Expand Down
2 changes: 1 addition & 1 deletion src/pk/asn1/der/sequence/der_encode_sequence_multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...)
return CRYPT_NOP;
}

list = XCALLOC(sizeof(*list), x);
list = XCALLOC(x, sizeof(*list));
if (list == NULL) {
return CRYPT_MEM;
}
Expand Down

0 comments on commit 2302a3a

Please sign in to comment.