mirror of https://github.com/wolfSSL/wolfssl.git
fp_set_bit: return error when bit offset is too large
If the bit to set is beyond the predefined maximum size then return an error. Same for fp_is_bit_set().pull/3135/head
parent
fbe0c8cba7
commit
eb7a01342f
|
@ -3311,8 +3311,8 @@ int fp_is_bit_set (fp_int *a, fp_digit b)
|
|||
fp_digit i;
|
||||
|
||||
if (b > FP_MAX_BITS)
|
||||
return 0;
|
||||
else
|
||||
return FP_VAL;
|
||||
|
||||
i = b/DIGIT_BIT;
|
||||
|
||||
if ((fp_digit)a->used < i)
|
||||
|
@ -3327,8 +3327,8 @@ int fp_set_bit (fp_int * a, fp_digit b)
|
|||
fp_digit i;
|
||||
|
||||
if (b > FP_MAX_BITS)
|
||||
return 0;
|
||||
else
|
||||
return FP_VAL;
|
||||
|
||||
i = b/DIGIT_BIT;
|
||||
|
||||
/* set the used count of where the bit will go if required */
|
||||
|
|
Loading…
Reference in New Issue