Skip to content

Commit 066fc53

Browse files
cmd/jwk: check return from jose_jwk_thp_buf() properly
jose_jwk_thp_buf() returns, on success, the number of bytes written; otherwise, it returns SIZE_MAX. We now check its return properly, from jcmd_jwk_thp(), which is used by the CLI utility. Signed-off-by: Sergio Correia <[email protected]>
1 parent 874c665 commit 066fc53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/jwk/thp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ jcmd_jwk_thp(int argc, char *argv[])
153153
if (!opt.find && strcmp(opt.hash, a->name) != 0)
154154
continue;
155155

156-
if (!jose_jwk_thp_buf(NULL, jwk, opt.hash, dec, sizeof(dec))) {
156+
if (jose_jwk_thp_buf(NULL, jwk, opt.hash, dec, sizeof(dec)) == SIZE_MAX) {
157157
fprintf(stderr, "Error making thumbprint!\n");
158158
return EXIT_FAILURE;
159159
}

0 commit comments

Comments
 (0)