mirror of
https://codeberg.org/wownero/wownero-lws
synced 2026-01-08 22:55:15 -08:00
Fix divide by zero in db code (#219)
This commit is contained in:
committed by
Lee *!* Clagett
parent
770e3b0ca4
commit
332c969c74
@@ -2372,7 +2372,7 @@ namespace db
|
||||
const auto this_minor = add_and_clamp(minor - 1, to_uint(receipient->min_i));
|
||||
|
||||
// Quick Sanity Check before vector expansion
|
||||
if (std::numeric_limits<std::uint32_t>::max() < needed / minor)
|
||||
if (minor && std::numeric_limits<std::uint32_t>::max() < needed / minor)
|
||||
return {error::max_subaddresses};
|
||||
if (max_subaddresses < needed * minor)
|
||||
return {error::max_subaddresses};
|
||||
|
||||
Reference in New Issue
Block a user