fix: diseqc.eDVBDiseqcCommand::data[n] is used uninitialized in this function
authorAndreas Oberritter <obi@opendreambox.org>
Tue, 25 Mar 2008 23:50:09 +0000 (23:50 +0000)
committerAndreas Oberritter <obi@opendreambox.org>
Tue, 25 Mar 2008 23:50:09 +0000 (23:50 +0000)
lib/dvb/sec.cpp

index 655f64fca0be73995c08d06c89fec0953e6544dd..1e75d113419a2347a777fd221adfc55db2e6a0b2 100644 (file)
@@ -550,6 +550,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                                                        for ( int i = 0; i < loops;)  // fill commands...
                                                        {
                                                                eDVBDiseqcCommand diseqc;
                                                        for ( int i = 0; i < loops;)  // fill commands...
                                                        {
                                                                eDVBDiseqcCommand diseqc;
+                                                               memset(diseqc.data, 0, MAX_DISEQC_LENGTH);
                                                                diseqc.len = 4;
                                                                diseqc.data[0] = i ? 0xE1 : 0xE0;
                                                                diseqc.data[1] = 0x10;
                                                                diseqc.len = 4;
                                                                diseqc.data[0] = i ? 0xE1 : 0xE0;
                                                                diseqc.data[1] = 0x10;
@@ -637,6 +638,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_BETWEEN_SWITCH_AND_MOTOR_CMD]) ); // wait 700ms when diseqc changed
 
                                                eDVBDiseqcCommand diseqc;
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_BETWEEN_SWITCH_AND_MOTOR_CMD]) ); // wait 700ms when diseqc changed
 
                                                eDVBDiseqcCommand diseqc;
+                                               memset(diseqc.data, 0, MAX_DISEQC_LENGTH);
                                                diseqc.len = 3;
                                                diseqc.data[0] = 0xE0;
                                                diseqc.data[1] = 0x31;  // positioner
                                                diseqc.len = 3;
                                                diseqc.data[0] = 0xE0;
                                                diseqc.data[1] = 0x31;  // positioner