mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-23 18:47:36 -07:00
cryptonote_basic: fix amount overflow detection on 32-bit systems [RELEASE]
This commit is contained in:
parent
1ce32d8536
commit
cfc62277c0
@ -1229,7 +1229,7 @@ namespace cryptonote
|
|||||||
char *end = NULL;
|
char *end = NULL;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
const unsigned long long ull = strtoull(buf, &end, 10);
|
const unsigned long long ull = strtoull(buf, &end, 10);
|
||||||
CHECK_AND_ASSERT_THROW_MES(ull != ULONG_MAX || errno == 0, "Failed to parse rounded amount: " << buf);
|
CHECK_AND_ASSERT_THROW_MES(ull != ULLONG_MAX || errno == 0, "Failed to parse rounded amount: " << buf);
|
||||||
CHECK_AND_ASSERT_THROW_MES(ull != 0 || amount == 0, "Overflow in rounding");
|
CHECK_AND_ASSERT_THROW_MES(ull != 0 || amount == 0, "Overflow in rounding");
|
||||||
return ull;
|
return ull;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user