Skip to content

Commit

Permalink
Fix bn_x2bn
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Sep 17, 2024
1 parent 6cfcaae commit f19df5a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crypto/bn_extra/convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ static int bn_x2bn(BIGNUM **outp, const char *in, decode_func decode, char_test_

for (i = 0; want_char((unsigned char)in[i]) && i + neg < INT_MAX; i++) {}

if(i == 0) {
OPENSSL_PUT_ERROR(BN, BN_R_INVALID_INPUT);
return 0;
}

num = i + neg;
if (outp == NULL) {
return num;
Expand Down

0 comments on commit f19df5a

Please sign in to comment.