Skip to content

Commit

Permalink
template_kem.c: Use proper printf format for size_t
Browse files Browse the repository at this point in the history
Fixes Coverity 1633351, 1633352, 1633354, 1633355
  • Loading branch information
t8m committed Jan 22, 2025
1 parent 5671a8d commit af882f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions providers/implementations/kem/template_kem.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static int template_encapsulate(void *vctx, unsigned char *out, size_t *outlen,

if (out == NULL) {
if (outlen != NULL && secretlen != NULL)
debug_print("encaps outlens set to %d and %d\n", *outlen, *secretlen);
debug_print("encaps outlens set to %zu and %zu\n", *outlen, *secretlen);
return 1;
}

Expand All @@ -157,7 +157,7 @@ static int template_encapsulate(void *vctx, unsigned char *out, size_t *outlen,
static int template_decapsulate(void *vctx, unsigned char *out, size_t *outlen,
const unsigned char *in, size_t inlen)
{
debug_print("decaps %p to %p inlen at %d\n", vctx, out, inlen);
debug_print("decaps %p to %p inlen at %zu\n", vctx, out, inlen);

/* add algorithm-specific length checks */

Expand All @@ -166,7 +166,7 @@ static int template_decapsulate(void *vctx, unsigned char *out, size_t *outlen,

if (out == NULL) {
if (outlen != NULL)
debug_print("decaps outlen set to %d \n", *outlen);
debug_print("decaps outlen set to %zu \n", *outlen);
return 1;
}

Expand Down

0 comments on commit af882f5

Please sign in to comment.