Add assert to ensure TestAddress will not be higher than the uchar max

This commit is contained in:
Tyler Neely 2022-11-18 10:19:55 +00:00
parent 6b9a617df0
commit a37e7e4aff

View File

@ -58,6 +58,8 @@ struct Address {
uint16_t last_known_port;
static Address TestAddress(uint16_t port) {
MG_ASSERT(port <= 255);
return Address{
.unique_id = boost::uuids::uuid{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, static_cast<unsigned char>(port)},
.last_known_port = port,