forked from townforge/townforge
cc: add paranoid static assert about MIN_BUY_SIDE_SIZE
This commit is contained in:
parent
3b479592a8
commit
302bcbef8f
@ -58,6 +58,7 @@ bool cc_command_handler_buy_land::check(const cryptonote::BlockchainDB &db, cons
|
||||
MERROR("buy_land size below minimum");
|
||||
return false;
|
||||
}
|
||||
static_assert(MIN_BUY_SIDE_SIZE > 0, "The test below allows building to the max limit, which will break some uint32_t based loops");
|
||||
if (buy_land.x < MIN_BUY_SIDE_SIZE || buy_land.x > std::numeric_limits<uint32_t>::max() - buy_land.wm1 - MIN_BUY_SIDE_SIZE)
|
||||
{
|
||||
MERROR("buy_land area too close to edge");
|
||||
|
Loading…
Reference in New Issue
Block a user