Add assert to ensure TestAddress will not be higher than the uchar max
This commit is contained in:
parent
6b9a617df0
commit
a37e7e4aff
@ -58,6 +58,8 @@ struct Address {
|
|||||||
uint16_t last_known_port;
|
uint16_t last_known_port;
|
||||||
|
|
||||||
static Address TestAddress(uint16_t port) {
|
static Address TestAddress(uint16_t port) {
|
||||||
|
MG_ASSERT(port <= 255);
|
||||||
|
|
||||||
return Address{
|
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)},
|
.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,
|
.last_known_port = port,
|
||||||
|
Loading…
Reference in New Issue
Block a user