Skip to content

Commit

Permalink
openssl/oct: improve bound check for len (#162)
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Correia <[email protected]>
  • Loading branch information
sergio-correia authored May 22, 2024
1 parent be761d2 commit fed2dc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/openssl/oct.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jwk_make_execute(jose_cfg_t *cfg, json_t *jwk)
if (json_unpack(jwk, "{s:I}", "bytes", &len) < 0)
return false;

if (len > KEYMAX)
if (len <= 0 || len > KEYMAX)
return false;

if (RAND_bytes(key, len) <= 0)
Expand Down

0 comments on commit fed2dc7

Please sign in to comment.