mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-26 22:57:00 +02:00
Merge pull request #3696 from 678098/fix_port_int16_t_overflow
Fix: prevent possible int16_t overflow
This commit is contained in:
commit
5d8432bd24
@ -289,7 +289,7 @@ void GlobalLobbyClient::receiveJoinRoomSuccess(const JsonNode & json)
|
||||
CSH->loadMode = ELoadMode::MULTI;
|
||||
|
||||
std::string hostname = settings["lobby"]["hostname"].String();
|
||||
int16_t port = settings["lobby"]["port"].Integer();
|
||||
uint16_t port = settings["lobby"]["port"].Integer();
|
||||
CSH->connectToServer(hostname, port);
|
||||
}
|
||||
|
||||
@ -379,7 +379,7 @@ void GlobalLobbyClient::sendOpenRoom(const std::string & mode, int playerLimit)
|
||||
void GlobalLobbyClient::connect()
|
||||
{
|
||||
std::string hostname = settings["lobby"]["hostname"].String();
|
||||
int16_t port = settings["lobby"]["port"].Integer();
|
||||
uint16_t port = settings["lobby"]["port"].Integer();
|
||||
CSH->getNetworkHandler().connectToRemote(*this, hostname, port);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ GlobalLobbyProcessor::GlobalLobbyProcessor(CVCMIServer & owner)
|
||||
void GlobalLobbyProcessor::establishNewConnection()
|
||||
{
|
||||
std::string hostname = settings["lobby"]["hostname"].String();
|
||||
int16_t port = settings["lobby"]["port"].Integer();
|
||||
uint16_t port = settings["lobby"]["port"].Integer();
|
||||
owner.getNetworkHandler().connectToRemote(*this, hostname, port);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user