mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Added NULL checks for cSatipServer parameters.
This commit is contained in:
parent
184ddf2a53
commit
b466d6836e
@ -239,7 +239,7 @@ void cSatipDiscover::AddServer(const char *addrP, const char *modelP, const char
|
||||
char *r = strtok_r(p, ",", &s);
|
||||
while (r) {
|
||||
r = skipspace(r);
|
||||
cString desc = cString::sprintf("%s #%d", descP, n++);
|
||||
cString desc = cString::sprintf("%s #%d", !isempty(descP) ? descP : "MyBrokenHardware", n++);
|
||||
cSatipServer *tmp = new cSatipServer(addrP, r, desc);
|
||||
if (!serversM.Update(tmp)) {
|
||||
info("Adding server '%s|%s|%s'", tmp->Address(), tmp->Model(), tmp->Description());
|
||||
@ -247,7 +247,7 @@ void cSatipDiscover::AddServer(const char *addrP, const char *modelP, const char
|
||||
}
|
||||
else
|
||||
DELETENULL(tmp);
|
||||
r = strtok_r(NULL, ",\n", &s);
|
||||
r = strtok_r(NULL, ",", &s);
|
||||
}
|
||||
FREE_POINTER(p);
|
||||
}
|
||||
|
10
server.c
10
server.c
@ -15,9 +15,9 @@
|
||||
// --- cSatipServer -----------------------------------------------------------
|
||||
|
||||
cSatipServer::cSatipServer(const char *addressP, const char *modelP, const char *descriptionP)
|
||||
: addressM(addressP),
|
||||
modelM(modelP),
|
||||
descriptionM(descriptionP),
|
||||
: addressM((addressP && *addressP) ? addressP : "0.0.0.0"),
|
||||
modelM((modelP && *modelP) ? modelP : "DVBS-1"),
|
||||
descriptionM(!isempty(descriptionP) ? descriptionP : "MyBrokenHardware"),
|
||||
modelTypeM(eSatipModelTypeNone),
|
||||
quirkM(eSatipQuirkNone),
|
||||
useCountM(0),
|
||||
@ -26,9 +26,6 @@ cSatipServer::cSatipServer(const char *addressP, const char *modelP, const char
|
||||
lastSeenM(0)
|
||||
{
|
||||
memset(modelCountM, 0, sizeof(modelCountM));
|
||||
if (isempty(*modelM))
|
||||
modelM = "DVBS-1";
|
||||
if (!isempty(*descriptionM)) {
|
||||
// These devices contain a session id bug:
|
||||
// Inverto Airscreen Server IDL 400 ?
|
||||
// Elgato EyeTV Netstream 4Sat ?
|
||||
@ -48,7 +45,6 @@ cSatipServer::cSatipServer(const char *addressP, const char *modelP, const char
|
||||
// These devices support the X_PMT protocol extension
|
||||
if (strstr(*descriptionM, "OctopusNet")) // Digital Devices OctopusNet
|
||||
quirkM |= eSatipQuirkUseXCI;
|
||||
}
|
||||
char *s, *p = strdup(*modelM);
|
||||
char *r = strtok_r(p, ",", &s);
|
||||
while (r) {
|
||||
|
Loading…
Reference in New Issue
Block a user