Catch forgetting to initialize packetSize field

This commit is contained in:
Cameron Gutman 2018-11-21 20:36:49 -08:00
parent 396b02a94d
commit 42df6475c8

View File

@ -177,10 +177,17 @@ int LiStartConnection(PSERVER_INFORMATION serverInfo, PSTREAM_CONFIGURATION stre
// the given packet size to the nearest multiple of 16.
StreamConfig.packetSize -= StreamConfig.packetSize % 16;
if (StreamConfig.packetSize == 0) {
Limelog("Invalid packet size specified\n");
free(RemoteAddrString);
return -1;
}
// Extract the appversion from the supplied string
if (extractVersionQuadFromString(serverInfo->serverInfoAppVersion,
AppVersionQuad) < 0) {
Limelog("Invalid appversion string: %s\n", serverInfo->serverInfoAppVersion);
free(RemoteAddrString);
return -1;
}