Skip to content

Commit

Permalink
openssl/oct: improve bound check for len
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Correia <[email protected]>
  • Loading branch information
sergio-correia committed May 20, 2024
1 parent efb5cfa commit 97f0d6a
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 97f0d6a

Please sign in to comment.