eDVBCAHandler: Prevent memory access of out of scope local variable
authorbetacentauri <betacentauri@arcor.de>
Sat, 16 May 2015 12:13:01 +0000 (14:13 +0200)
committerErik Slagter <erik@openpli.org>
Sat, 16 May 2015 17:55:58 +0000 (19:55 +0200)
Signed-off-by: Erik Slagter <erik@openpli.org>

lib/dvb/cahandler.cpp
lib/dvb/cahandler.h

index 07067ed..b869cf0 100644 (file)
@@ -326,7 +326,7 @@ int eDVBCAHandler::unregisterService(const eServiceReferenceDVB &ref, int adapte
                                {
                                        if (!freed && caservice->getUsedDemux(iter) == demux_nums[i])
                                        {
-                                               eDebug("[eDVBCAService] free slot %d demux %d for service %s", iter, demux_nums[i], caservice->toString());
+                                               eDebug("[eDVBCAService] free slot %d demux %d for service %s", iter, demux_nums[i], caservice->toString().c_str());
                                                caservice->setUsedDemux(iter, 0xFF);
                                                freed = true;
                                        }
@@ -474,9 +474,9 @@ eDVBCAService::~eDVBCAService()
        eDebug("[eDVBCAService] free service %s", m_service.toString().c_str());
 }
 
-const char *eDVBCAService::toString()
+std::string eDVBCAService::toString()
 {
-       return m_service.toString().c_str();
+       return m_service.toString();
 }
 
 int eDVBCAService::getCAPMTVersion()
index 25ae575..6ebe6ba 100644 (file)
@@ -114,7 +114,7 @@ public:
        eDVBCAService(const eServiceReferenceDVB &service);
        ~eDVBCAService();
 
-       const char *toString();
+       std::string toString();
        int getCAPMTVersion();
        int getNumberOfDemuxes();
        uint8_t getUsedDemux(int index);