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);
|
char *r = strtok_r(p, ",", &s);
|
||||||
while (r) {
|
while (r) {
|
||||||
r = skipspace(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);
|
cSatipServer *tmp = new cSatipServer(addrP, r, desc);
|
||||||
if (!serversM.Update(tmp)) {
|
if (!serversM.Update(tmp)) {
|
||||||
info("Adding server '%s|%s|%s'", tmp->Address(), tmp->Model(), tmp->Description());
|
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
|
else
|
||||||
DELETENULL(tmp);
|
DELETENULL(tmp);
|
||||||
r = strtok_r(NULL, ",\n", &s);
|
r = strtok_r(NULL, ",", &s);
|
||||||
}
|
}
|
||||||
FREE_POINTER(p);
|
FREE_POINTER(p);
|
||||||
}
|
}
|
||||||
|
10
server.c
10
server.c
@ -15,9 +15,9 @@
|
|||||||
// --- cSatipServer -----------------------------------------------------------
|
// --- cSatipServer -----------------------------------------------------------
|
||||||
|
|
||||||
cSatipServer::cSatipServer(const char *addressP, const char *modelP, const char *descriptionP)
|
cSatipServer::cSatipServer(const char *addressP, const char *modelP, const char *descriptionP)
|
||||||
: addressM(addressP),
|
: addressM((addressP && *addressP) ? addressP : "0.0.0.0"),
|
||||||
modelM(modelP),
|
modelM((modelP && *modelP) ? modelP : "DVBS-1"),
|
||||||
descriptionM(descriptionP),
|
descriptionM(!isempty(descriptionP) ? descriptionP : "MyBrokenHardware"),
|
||||||
modelTypeM(eSatipModelTypeNone),
|
modelTypeM(eSatipModelTypeNone),
|
||||||
quirkM(eSatipQuirkNone),
|
quirkM(eSatipQuirkNone),
|
||||||
useCountM(0),
|
useCountM(0),
|
||||||
@ -26,9 +26,6 @@ cSatipServer::cSatipServer(const char *addressP, const char *modelP, const char
|
|||||||
lastSeenM(0)
|
lastSeenM(0)
|
||||||
{
|
{
|
||||||
memset(modelCountM, 0, sizeof(modelCountM));
|
memset(modelCountM, 0, sizeof(modelCountM));
|
||||||
if (isempty(*modelM))
|
|
||||||
modelM = "DVBS-1";
|
|
||||||
if (!isempty(*descriptionM)) {
|
|
||||||
// These devices contain a session id bug:
|
// These devices contain a session id bug:
|
||||||
// Inverto Airscreen Server IDL 400 ?
|
// Inverto Airscreen Server IDL 400 ?
|
||||||
// Elgato EyeTV Netstream 4Sat ?
|
// 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
|
// These devices support the X_PMT protocol extension
|
||||||
if (strstr(*descriptionM, "OctopusNet")) // Digital Devices OctopusNet
|
if (strstr(*descriptionM, "OctopusNet")) // Digital Devices OctopusNet
|
||||||
quirkM |= eSatipQuirkUseXCI;
|
quirkM |= eSatipQuirkUseXCI;
|
||||||
}
|
|
||||||
char *s, *p = strdup(*modelM);
|
char *s, *p = strdup(*modelM);
|
||||||
char *r = strtok_r(p, ",", &s);
|
char *r = strtok_r(p, ",", &s);
|
||||||
while (r) {
|
while (r) {
|
||||||
|
Loading…
Reference in New Issue
Block a user