add port range

pull/135/head
Simon Stürz 2015-06-12 16:36:13 +02:00 committed by Michael Zanetti
parent 8bcb535ad9
commit 6a73d592b4
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ DeviceManager::DeviceSetupStatus DevicePluginUdpCommander::setupDevice(Device *d
// check port
bool portOk = false;
int port = device->paramValue("port").toInt(&portOk);
if (!portOk) {
if (!portOk || port <= 0 || port > 65535) {
qWarning() << "ERROR: UDP commander" << device->paramValue("name") << ": invalid port:" << device->paramValue("port").toString() << ".";
return DeviceManager::DeviceSetupStatusFailure;
}