Skip to content

Commit

Permalink
Fix crash when CI module is deactivated in the menu
Browse files Browse the repository at this point in the history
Initialize all pointers and variables in the constructor
to avoid crash.
  • Loading branch information
betacentauri authored and TwolDE2 committed Apr 22, 2024
1 parent 3bf2356 commit 90eee39
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/dvb_ci/dvbci.cpp
Expand Up @@ -1265,6 +1265,15 @@ eDVBCISlot::eDVBCISlot(eMainloop *context, int nr)
m_context = context;
m_ciplus_routing_tunernum = -1;
state = stateDisabled;
application_manager = 0;
mmi_session = 0;
ca_manager = 0;
cc_manager = 0;
use_count = 0;
linked_next = 0;
user_mapped = false;
plugged = false;
m_ci_version = versionUnknown;
snprintf(configStr, 255, "config.ci.%d.enabled", slotid);
bool enabled = eConfigManager::getConfigBoolValue(configStr, true);
if (enabled)
Expand All @@ -1277,15 +1286,7 @@ void eDVBCISlot::openDevice()
{
char filename[128];

application_manager = 0;
mmi_session = 0;
ca_manager = 0;
cc_manager = 0;
use_count = 0;
linked_next = 0;
user_mapped = false;
plugged = true;
m_ci_version = versionUnknown;

sprintf(filename, "/dev/ci%d", slotid);

Expand Down

0 comments on commit 90eee39

Please sign in to comment.