Skip to content

Commit 97f0d6a

Browse files
openssl/oct: improve bound check for len
Signed-off-by: Sergio Correia <[email protected]>
1 parent efb5cfa commit 97f0d6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/openssl/oct.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jwk_make_execute(jose_cfg_t *cfg, json_t *jwk)
4545
if (json_unpack(jwk, "{s:I}", "bytes", &len) < 0)
4646
return false;
4747

48-
if (len > KEYMAX)
48+
if (len <= 0 || len > KEYMAX)
4949
return false;
5050

5151
if (RAND_bytes(key, len) <= 0)

0 commit comments

Comments
 (0)