diff options
author | christian mueller <christian.ei.mueller@bmw.de> | 2012-05-03 14:40:20 +0200 |
---|---|---|
committer | christian mueller <christian.ei.mueller@bmw.de> | 2012-05-24 13:40:22 +0200 |
commit | 6681a98594680fe6ab15abeeb0ea915c44d7ad6a (patch) | |
tree | b1dbb1d46a5019963d4061fb4463032ef4deb09d | |
parent | bfafb8c4ded216a2cae6e376e69c9bc2dca117e6 (diff) | |
download | audiomanager-6681a98594680fe6ab15abeeb0ea915c44d7ad6a.tar.gz |
* [GAM-74] resolving issues found by coverity scan
Signed-off-by: christian mueller <christian.ei.mueller@bmw.de>
18 files changed, 111 insertions, 57 deletions
diff --git a/AudioManagerDaemon/include/CAmDatabaseHandler.h b/AudioManagerDaemon/include/CAmDatabaseHandler.h index 8509594..e8e44c2 100644 --- a/AudioManagerDaemon/include/CAmDatabaseHandler.h +++ b/AudioManagerDaemon/include/CAmDatabaseHandler.h @@ -129,7 +129,7 @@ public: am_Error_e getDomainOfSource(const am_sourceID_t sourceID, am_domainID_t& domainID) const; am_Error_e getDomainOfSink(const am_sinkID_t sinkID, am_domainID_t& domainID) const; am_Error_e getSoureState(const am_sourceID_t sourceID, am_SourceState_e& sourceState) const; - am_Error_e getDomainState(const am_domainID_t domainID, am_DomainState_e state) const; + am_Error_e getDomainState(const am_domainID_t domainID, am_DomainState_e& state) const; am_Error_e getRoutingTree(bool onlyfree, CAmRoutingTree& tree, std::vector<CAmRoutingTreeItem*>& flatTree); am_Error_e peekDomain(const std::string& name, am_domainID_t& domainID); am_Error_e peekSink(const std::string& name, am_sinkID_t& sinkID); diff --git a/AudioManagerDaemon/include/CAmRoutingReceiver.h b/AudioManagerDaemon/include/CAmRoutingReceiver.h index e8558c1..ca2a4b4 100644 --- a/AudioManagerDaemon/include/CAmRoutingReceiver.h +++ b/AudioManagerDaemon/include/CAmRoutingReceiver.h @@ -95,9 +95,9 @@ private: CAmSocketHandler *mpSocketHandler; //!< pointer to sockethandler CAmDbusWrapper *mpDBusWrapper; //!< pointer to dbuswrapper - uint16_t handleCount; //!< counts all handles std::vector<uint16_t> mListStartupHandles; //!< list of handles that wait for a confirm std::vector<uint16_t> mListRundownHandles; //!< list of handles that wait for a confirm + uint16_t handleCount; //!< counts all handles bool mWaitStartup; //!< if true confirmation will be sent if list of handles = 0 bool mWaitRundown; //!< if true confirmation will be sent if list of handles = 0 diff --git a/AudioManagerDaemon/src/CAmCommandReceiver.cpp b/AudioManagerDaemon/src/CAmCommandReceiver.cpp index d656720..c507d5f 100644 --- a/AudioManagerDaemon/src/CAmCommandReceiver.cpp +++ b/AudioManagerDaemon/src/CAmCommandReceiver.cpp @@ -33,7 +33,9 @@ namespace am CAmCommandReceiver::CAmCommandReceiver(CAmDatabaseHandler *iDatabaseHandler, CAmControlSender *iControlSender, CAmSocketHandler *iSocketHandler) : mDatabaseHandler(iDatabaseHandler), // mControlSender(iControlSender), // + mDBusWrapper(NULL), // mSocketHandler(iSocketHandler), // + handleCount(0),// mListStartupHandles(), // mListRundownHandles(), // mWaitStartup(false), // @@ -50,6 +52,7 @@ CAmCommandReceiver::CAmCommandReceiver(CAmDatabaseHandler *iDatabaseHandler, CAm mControlSender(iControlSender), // mDBusWrapper(iDBusWrapper), // mSocketHandler(iSocketHandler), // + handleCount(0),// mListStartupHandles(), // mListRundownHandles(), // mWaitStartup(false), // @@ -165,6 +168,7 @@ am_Error_e CAmCommandReceiver::getDBusConnectionWrapper(CAmDbusWrapper*& dbusCon dbusConnectionWrapper = mDBusWrapper; return (E_OK); #else + dbusConnectionWrapper = NULL; return (E_UNKNOWN); #endif /*WITH_DBUS_WRAPPER*/ } diff --git a/AudioManagerDaemon/src/CAmCommandSender.cpp b/AudioManagerDaemon/src/CAmCommandSender.cpp index 2199a42..b3609de 100644 --- a/AudioManagerDaemon/src/CAmCommandSender.cpp +++ b/AudioManagerDaemon/src/CAmCommandSender.cpp @@ -107,6 +107,7 @@ CAmCommandSender::CAmCommandSender(const std::vector<std::string>& listOfPluginD if (!commander) { logInfo("CommandPlugin initialization failed. Entry Function not callable"); + dlclose(tempLibHandle); continue; } @@ -120,6 +121,7 @@ CAmCommandSender::CAmCommandSender(const std::vector<std::string>& listOfPluginD if (majorVersion < REQUIRED_INTERFACE_VERSION_MAJOR || ((majorVersion == REQUIRED_INTERFACE_VERSION_MAJOR) && (minorVersion > REQUIRED_INTERFACE_VERSION_MINOR))) { logInfo("CommandInterface initialization failed. Version of Interface to old"); + dlclose(tempLibHandle); continue; } diff --git a/AudioManagerDaemon/src/CAmControlReceiver.cpp b/AudioManagerDaemon/src/CAmControlReceiver.cpp index 23ae544..51a2225 100644 --- a/AudioManagerDaemon/src/CAmControlReceiver.cpp +++ b/AudioManagerDaemon/src/CAmControlReceiver.cpp @@ -63,6 +63,7 @@ am_Error_e CAmControlReceiver::connect(am_Handle_s & handle, am_connectionID_t & tempConnection.sourceID = sourceID; tempConnection.connectionFormat = format; tempConnection.connectionID = 0; + tempConnection.delay=-1; //todo: enter function to find out what happends if the same connection is in the course of being build up. if (mDatabaseHandler->existConnection(tempConnection)) diff --git a/AudioManagerDaemon/src/CAmDatabaseHandler.cpp b/AudioManagerDaemon/src/CAmDatabaseHandler.cpp index 1f7e9f8..e4e0bff 100644 --- a/AudioManagerDaemon/src/CAmDatabaseHandler.cpp +++ b/AudioManagerDaemon/src/CAmDatabaseHandler.cpp @@ -21,6 +21,7 @@ #include "CAmDatabaseHandler.h" #include <cassert> +#include <stdexcept> #include <vector> #include <fstream> #include <sstream> @@ -3844,7 +3845,7 @@ am_Error_e CAmDatabaseHandler::getSourceSoundPropertyValue(const am_sourceID_t s return (E_OK); } -am_Error_e CAmDatabaseHandler::getDomainState(const am_domainID_t domainID, am_DomainState_e state) const +am_Error_e CAmDatabaseHandler::getDomainState(const am_domainID_t domainID, am_DomainState_e& state) const { assert(domainID!=0); sqlite3_stmt* query = NULL; diff --git a/AudioManagerDaemon/src/CAmDatabaseObserver.cpp b/AudioManagerDaemon/src/CAmDatabaseObserver.cpp index ae81a4e..0b8b481 100644 --- a/AudioManagerDaemon/src/CAmDatabaseObserver.cpp +++ b/AudioManagerDaemon/src/CAmDatabaseObserver.cpp @@ -36,6 +36,7 @@ namespace am { CAmDatabaseObserver::CAmDatabaseObserver(CAmCommandSender *iCommandSender, CAmRoutingSender *iRoutingSender, CAmSocketHandler *iSocketHandler) : mCommandSender(iCommandSender), // mRoutingSender(iRoutingSender), // + mTelnetServer(NULL), // mSerializer(iSocketHandler) // { assert(mCommandSender!=0); diff --git a/AudioManagerDaemon/src/CAmDbusWrapper.cpp b/AudioManagerDaemon/src/CAmDbusWrapper.cpp index 592d58e..76290ee 100644 --- a/AudioManagerDaemon/src/CAmDbusWrapper.cpp +++ b/AudioManagerDaemon/src/CAmDbusWrapper.cpp @@ -26,6 +26,7 @@ #include <string> #include <cassert> #include <cstdlib> +#include <stdexcept> #include "shared/CAmDltWrapper.h" #include "shared/CAmSocketHandler.h" @@ -104,8 +105,8 @@ CAmDbusWrapper::CAmDbusWrapper(CAmSocketHandler* socketHandler, DBusBusType type } if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER != ret) { - logError("DBusWrapper::DBusWrapper Wrapper is not the Primary Owner ! Another instance already running?", ret); - exit(1); + logError("DBusWrapper::DBusWrapper Wrapper is not the Primary Owner ! Another instance already running?"); + throw std::runtime_error("DBusWrapper::DBusWrapper Wrapper is not the Primary Owner ! Another instance already running?"); } } @@ -260,9 +261,15 @@ void CAmDbusWrapper::removeWatchDelegate(DBusWatch *watch, void *userData) std::map<DBusWatch*, sh_pollHandle_t>::iterator iterator = mMapHandleWatch.begin(); iterator = mMapHandleWatch.find(watch); if (iterator != mMapHandleWatch.end()) + { mpSocketHandler->removeFDPoll(iterator->second); - logInfo("DBusWrapper::removeWatch removed watch with handle", iterator->second); - mMapHandleWatch.erase(iterator); + logInfo("DBusWrapper::removeWatch removed watch with handle", iterator->second); + mMapHandleWatch.erase(iterator); + } + else + { + logError("DBusWrapper::removeWatch could not find handle !"); + } } void CAmDbusWrapper::toogleWatch(DBusWatch *watch, void *userData) @@ -302,6 +309,8 @@ dbus_bool_t CAmDbusWrapper::addTimeout(DBusTimeout *timeout, void* userData) dbus_bool_t CAmDbusWrapper::addTimeoutDelegate(DBusTimeout *timeout, void* userData) { + (void)userData; + if (!dbus_timeout_get_enabled(timeout)) return (false); diff --git a/AudioManagerDaemon/src/CAmRoutingReceiver.cpp b/AudioManagerDaemon/src/CAmRoutingReceiver.cpp index ea6bfeb..1fb0dac 100644 --- a/AudioManagerDaemon/src/CAmRoutingReceiver.cpp +++ b/AudioManagerDaemon/src/CAmRoutingReceiver.cpp @@ -38,6 +38,7 @@ CAmRoutingReceiver::CAmRoutingReceiver(CAmDatabaseHandler *iDatabaseHandler, CAm mpSocketHandler(iSocketHandler), // mListStartupHandles(), // mListRundownHandles(), // + handleCount(0), // mWaitStartup(false), // mWaitRundown(false) { @@ -55,6 +56,7 @@ CAmRoutingReceiver::CAmRoutingReceiver(CAmDatabaseHandler *iDatabaseHandler, CAm mpDBusWrapper(iDBusWrapper), // mListStartupHandles(), // mListRundownHandles(), // + handleCount(0), // mWaitStartup(false), // mWaitRundown(false) { diff --git a/AudioManagerDaemon/src/CAmRoutingSender.cpp b/AudioManagerDaemon/src/CAmRoutingSender.cpp index b6279a7..050ff45 100644 --- a/AudioManagerDaemon/src/CAmRoutingSender.cpp +++ b/AudioManagerDaemon/src/CAmRoutingSender.cpp @@ -113,6 +113,7 @@ CAmRoutingSender::CAmRoutingSender(const std::vector<std::string>& listOfPluginD if (!router) { logError("RoutingSender::RoutingSender RoutingPlugin initialization failed. Entry Function not callable"); + dlclose(tempLibHandle); continue; } @@ -128,6 +129,7 @@ CAmRoutingSender::CAmRoutingSender(const std::vector<std::string>& listOfPluginD if (majorVersion < REQUIRED_INTERFACE_VERSION_MAJOR || ((majorVersion == REQUIRED_INTERFACE_VERSION_MAJOR) && (minorVersion > REQUIRED_INTERFACE_VERSION_MINOR))) { logInfo("RoutingPlugin initialization failed. Version of Interface to old"); + dlclose(tempLibHandle); continue; } diff --git a/AudioManagerDaemon/src/CAmSocketHandler.cpp b/AudioManagerDaemon/src/CAmSocketHandler.cpp index 27cb4bb..9bef60e 100644 --- a/AudioManagerDaemon/src/CAmSocketHandler.cpp +++ b/AudioManagerDaemon/src/CAmSocketHandler.cpp @@ -312,6 +312,8 @@ am_Error_e CAmSocketHandler::updateTimer(const sh_timerHandle_t handle, const ti //we add here the time difference between startTime and currenttime, because this time will be substracted later on in timecorrection timespec currentTime, timeoutsCorrected; + currentTime.tv_nsec=timeoutsCorrected.tv_nsec=0; + currentTime.tv_sec=timeoutsCorrected.tv_sec=0; clock_gettime(CLOCK_MONOTONIC, ¤tTime); if (!gDispatchDone) //the mainloop is started timeoutsCorrected = timespecAdd(timeouts, timespecSub(currentTime, mStartTime)); diff --git a/AudioManagerDaemon/src/CAmTelnetServer.cpp b/AudioManagerDaemon/src/CAmTelnetServer.cpp index 3af05af..ed28f9c 100644 --- a/AudioManagerDaemon/src/CAmTelnetServer.cpp +++ b/AudioManagerDaemon/src/CAmTelnetServer.cpp @@ -69,6 +69,7 @@ CAmTelnetServer::CAmTelnetServer(CAmSocketHandler *iSocketHandler, CAmCommandSen //setup the port Listener mConnectFD = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); + assert (mConnectFD>0); setsockopt(mConnectFD, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)); memset(&servAddr, 0, sizeof(servAddr)); servAddr.sin_family = AF_INET; @@ -107,6 +108,8 @@ void CAmTelnetServer::connectSocket(const pollfd pfd, const sh_pollHandle_t hand connection.handle = 0; connection.filedescriptor = accept(pfd.fd, (struct sockaddr*) &answer, &len); + assert(connection.filedescriptor>0); + // Notiy menuhelper mTelnetMenuHelper.newSocketConnection(connection.filedescriptor); @@ -167,6 +170,11 @@ bool CAmTelnetServer::dispatchData(const sh_pollHandle_t handle, void *userData) if (iterator->handle == handle) break; } + if (iterator==mListConnections.end()) + { + logError("CAmTelnetServer::dispatchData could not find handle !"); + return (false); + } std::string command; std::queue<std::string> MsgQueue; @@ -174,9 +182,12 @@ bool CAmTelnetServer::dispatchData(const sh_pollHandle_t handle, void *userData) { sliceCommand(mListMessages.front(), command, MsgQueue); mListMessages.pop(); + mTelnetMenuHelper.enterCmdQueue(MsgQueue, iterator->filedescriptor); + } + else + { + logError("CAmTelnetServer::dispatchData Message queue was empty!"); } - - mTelnetMenuHelper.enterCmdQueue(MsgQueue, iterator->filedescriptor); // must return false to stop endless polling return (false); diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp index b01b98d..ad908ec 100644 --- a/AudioManagerDaemon/src/main.cpp +++ b/AudioManagerDaemon/src/main.cpp @@ -270,44 +270,8 @@ static void signalHandler(int sig, siginfo_t *siginfo, void *context) exit(1); } -/** - * main - * @param argc - * @param argv - * @return - */ -int main(int argc, char *argv[]) +void mainProgram() { - listCommandPluginDirs.push_back(std::string(DEFAULT_PLUGIN_COMMAND_DIR)); - listRoutingPluginDirs.push_back(std::string(DEFAULT_PLUGIN_ROUTING_DIR)); - - //parse the commandline options - parseCommandLine(argc, (char**) argv); - - CAmDltWrapper::instance(enableNoDLTDebug)->registerApp("AudioManagerDeamon", "AudioManagerDeamon"); - CAmDltWrapper::instance()->registerContext(AudioManager, "Main", "Main Context"); - logInfo("The Audiomanager is started"); - logInfo("The version of the Audiomanager", DAEMONVERSION); - - //now the signal handler: - struct sigaction signalAction; - memset(&signalAction, '\0', sizeof(signalAction)); - signalAction.sa_sigaction = &signalHandler; - signalAction.sa_flags = SA_SIGINFO; - sigaction(SIGINT, &signalAction, NULL); - sigaction(SIGQUIT, &signalAction, NULL); - sigaction(SIGTERM, &signalAction, NULL); - sigaction(SIGHUP, &signalAction, NULL); - sigaction(SIGQUIT, &signalAction, NULL); - - struct sigaction signalChildAction; - memset(&signalChildAction, '\0', sizeof(signalChildAction)); - signalChildAction.sa_flags = SA_NOCLDWAIT; - sigaction(SIGCHLD, &signalChildAction, NULL); - - //register new out of memory handler - std::set_new_handler(&OutOfMemoryHandler); - //Instantiate all classes. Keep in same order ! CAmSocketHandler iSocketHandler; @@ -351,6 +315,60 @@ int main(int argc, char *argv[]) //start the mainloop here.... iSocketHandler.start_listenting(); +} + +/** + * main + * @param argc + * @param argv + * @return + */ +int main(int argc, char *argv[]) +{ + listCommandPluginDirs.push_back(std::string(DEFAULT_PLUGIN_COMMAND_DIR)); + listRoutingPluginDirs.push_back(std::string(DEFAULT_PLUGIN_ROUTING_DIR)); + + //parse the commandline options + parseCommandLine(argc, (char**) argv); + + CAmDltWrapper::instance(enableNoDLTDebug)->registerApp("AudioManagerDeamon", "AudioManagerDeamon"); + CAmDltWrapper::instance()->registerContext(AudioManager, "Main", "Main Context"); + logInfo("The Audiomanager is started"); + logInfo("The version of the Audiomanager", DAEMONVERSION); + + //now the signal handler: + struct sigaction signalAction; + memset(&signalAction, '\0', sizeof(signalAction)); + signalAction.sa_sigaction = &signalHandler; + signalAction.sa_flags = SA_SIGINFO; + sigaction(SIGINT, &signalAction, NULL); + sigaction(SIGQUIT, &signalAction, NULL); + sigaction(SIGTERM, &signalAction, NULL); + sigaction(SIGHUP, &signalAction, NULL); + sigaction(SIGQUIT, &signalAction, NULL); + + struct sigaction signalChildAction; + memset(&signalChildAction, '\0', sizeof(signalChildAction)); + signalChildAction.sa_flags = SA_NOCLDWAIT; + sigaction(SIGCHLD, &signalChildAction, NULL); + + //register new out of memory handler + std::set_new_handler(&OutOfMemoryHandler); + + try + { + //we do this to catch all exceptions and have a graceful ending just in case + mainProgram(); + } + + catch (std::exception& exc) + { + logError("The AudioManager ended by throwing the exception", exc.what()); + //todo: ergency exit here... call destructors etc... + exit(EXIT_FAILURE); + } + + close(fd0); close(fd1); close(fd2); diff --git a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp index 079625a..a1b7e39 100644 --- a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp +++ b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp @@ -330,7 +330,6 @@ TEST_F(CAmDatabaseHandlerTest,getSourceInfo) { equal = equal && pCF.compareSource(listIterator, secondDynamicSource); } - pCF.compareSource(listIterator, secondDynamicSource); }ASSERT_EQ(true, equal); diff --git a/PluginCommandInterfaceDbus/src/CAmDbusMessageHandler.cpp b/PluginCommandInterfaceDbus/src/CAmDbusMessageHandler.cpp index f84a994..94a0421 100644 --- a/PluginCommandInterfaceDbus/src/CAmDbusMessageHandler.cpp +++ b/PluginCommandInterfaceDbus/src/CAmDbusMessageHandler.cpp @@ -147,7 +147,7 @@ dbus_bool_t CAmDbusMessageHandler::getBool() char CAmDbusMessageHandler::getByte() { - char param; + char param(0); if (DBUS_TYPE_BYTE != dbus_message_iter_get_arg_type(&mDBusMessageIter)) { @@ -165,7 +165,7 @@ char CAmDbusMessageHandler::getByte() dbus_uint16_t CAmDbusMessageHandler::getUInt() { - dbus_uint16_t param; + dbus_uint16_t param(0); #ifdef GLIB_DBUS_TYPES_TOLERANT if (DBUS_TYPE_UINT16 != dbus_message_iter_get_arg_type(&mDBusMessageIter) && DBUS_TYPE_UINT32 != dbus_message_iter_get_arg_type(&mDBusMessageIter)) @@ -187,7 +187,7 @@ dbus_uint16_t CAmDbusMessageHandler::getUInt() dbus_int16_t CAmDbusMessageHandler::getInt() { - dbus_int16_t param; + dbus_int16_t param(0); #ifdef GLIB_DBUS_TYPES_TOLERANT if (DBUS_TYPE_INT16 != dbus_message_iter_get_arg_type(&mDBusMessageIter) && DBUS_TYPE_INT32 != dbus_message_iter_get_arg_type(&mDBusMessageIter)) @@ -209,7 +209,7 @@ dbus_int16_t CAmDbusMessageHandler::getInt() double CAmDbusMessageHandler::getDouble() { - double param; + double param(0); if (DBUS_TYPE_DOUBLE != dbus_message_iter_get_arg_type(&mDBusMessageIter)) { log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::getDouble DBUS handler argument is no double!"); diff --git a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusSignalTest.cpp b/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusSignalTest.cpp index 0ef24bc..34ef0c9 100644 --- a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusSignalTest.cpp +++ b/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusSignalTest.cpp @@ -33,7 +33,8 @@ using namespace am; using namespace testing; -CAmCommandSenderDbusSignalTest::CAmCommandSenderDbusSignalTest() +CAmCommandSenderDbusSignalTest::CAmCommandSenderDbusSignalTest() : + ppCommandSend(NULL) // { CAmDltWrapper::instance()->registerApp("dbusTest", "dbusTest"); logInfo("dbusCommandInterfaceSignalTest started"); diff --git a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusTest.cpp b/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusTest.cpp index 771a0d0..c12e3c1 100644 --- a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusTest.cpp +++ b/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusTest.cpp @@ -44,7 +44,8 @@ void* run_the_loop(void* wrapper) return (NULL); } -CAmCommandSenderDbusTest::CAmCommandSenderDbusTest() +CAmCommandSenderDbusTest::CAmCommandSenderDbusTest() : + ppCommandSend(NULL) // { CAmDltWrapper::instance()->registerApp("dbusTest", "dbusTest"); } diff --git a/PluginRoutingInterfaceDbus/src/CAmDbusMessageHandler.cpp b/PluginRoutingInterfaceDbus/src/CAmDbusMessageHandler.cpp index 65b77b6..e8c4826 100644 --- a/PluginRoutingInterfaceDbus/src/CAmDbusMessageHandler.cpp +++ b/PluginRoutingInterfaceDbus/src/CAmDbusMessageHandler.cpp @@ -161,7 +161,7 @@ dbus_bool_t CAmRoutingDbusMessageHandler::getBool() char CAmRoutingDbusMessageHandler::getByte(DBusMessageIter& iter, bool next) { - char param; + char param(0); if (DBUS_TYPE_BYTE != dbus_message_iter_get_arg_type(&iter)) { @@ -185,7 +185,7 @@ char CAmRoutingDbusMessageHandler::getByte() dbus_uint16_t CAmRoutingDbusMessageHandler::getUInt(DBusMessageIter& iter, bool next) { - dbus_uint16_t param; + dbus_uint16_t param(0); #ifdef GLIB_DBUS_TYPES_TOLERANT if (DBUS_TYPE_UINT16 != dbus_message_iter_get_arg_type(&iter) && DBUS_TYPE_UINT32 != dbus_message_iter_get_arg_type(&iter)) #else @@ -212,7 +212,7 @@ dbus_uint16_t CAmRoutingDbusMessageHandler::getUInt() dbus_int16_t CAmRoutingDbusMessageHandler::getInt(DBusMessageIter& iter, bool next) { - dbus_int16_t param; + dbus_int16_t param(0); #ifdef GLIB_DBUS_TYPES_TOLERANT if (DBUS_TYPE_INT16 != dbus_message_iter_get_arg_type(&iter) && DBUS_TYPE_INT32 != dbus_message_iter_get_arg_type(&iter)) #else @@ -239,7 +239,7 @@ dbus_int16_t CAmRoutingDbusMessageHandler::getInt() double CAmRoutingDbusMessageHandler::getDouble(DBusMessageIter& iter, bool next) { - double param; + double param(0); if (DBUS_TYPE_DOUBLE != dbus_message_iter_get_arg_type(&iter)) { log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getDouble DBUS handler argument is no double!"); |