mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-06 00:50:49 +02:00
return MP_VAL if n < 0. remove check for max int value
remove comment
This commit is contained in:
@@ -101,13 +101,12 @@ static int I2OSP(int n, int w, byte* out)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (w <= 0 || w > 32) {
|
||||
if (w <= 0 || w > 32 || n < 0) {
|
||||
return MP_VAL;
|
||||
}
|
||||
|
||||
/* if width is less than int max check that n is less than w bytes max */
|
||||
/* if width is greater than int max check that n is less than int max */
|
||||
if ((w < 4 && n > ((1 << (w * 8)) - 1)) || (w >= 4 && n > 0x7fffffff)) {
|
||||
if (w < 4 && n > ((1 << (w * 8)) - 1)) {
|
||||
return MP_VAL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user