diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-11 12:09:57 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-11 12:09:57 +0100 |
| commit | edf6beb585dc38c365ccbdaae85756b2814e1329 (patch) | |
| tree | c356fda7f3397c3b3427f56a5a1584cab7e513c5 /src/Daemon | |
| parent | 14ef0cfe72faf6696df3ef8f42927e9458ccbeeb (diff) | |
| download | abrt-edf6beb585dc38c365ccbdaae85756b2814e1329.tar.gz abrt-edf6beb585dc38c365ccbdaae85756b2814e1329.tar.xz abrt-edf6beb585dc38c365ccbdaae85756b2814e1329.zip | |
*: assorted fixes prompted by security analysis; more to come
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src/Daemon')
| -rw-r--r-- | src/Daemon/Daemon.cpp | 8 | ||||
| -rw-r--r-- | src/Daemon/MiddleWare.cpp | 2 | ||||
| -rw-r--r-- | src/Daemon/PluginManager.cpp | 2 | ||||
| -rw-r--r-- | src/Daemon/RPM.cpp | 4 |
4 files changed, 11 insertions, 5 deletions
diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 9e1aa0d..0f9c622 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -203,10 +203,12 @@ static int SetUpCron() int nM = -1; int nS = -1; +//TODO: rewrite using good old sscanf? + if (pos != std::string::npos) { - std::string sH = ""; - std::string sM = ""; + std::string sH; + std::string sM; sH = it_c->first.substr(0, pos); nH = xatou(sH.c_str()); @@ -221,7 +223,7 @@ static int SetUpCron() } else { - std::string sS = ""; + std::string sS; sS = it_c->first; nS = xatou(sS.c_str()); diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index 3656060..a348a92 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -548,6 +548,8 @@ report_status_t Report(const map_crash_report_t& pCrashReport, static bool IsDebugDumpSaved(const char *pUID, const char *pDebugDumpDir) { + /* TODO: use database query instead of dumping all rows and searching in them */ + CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase.c_str()); database->Connect(); vector_database_rows_t rows = database->GetUIDData(pUID); diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp index 697b964..a6550e7 100644 --- a/src/Daemon/PluginManager.cpp +++ b/src/Daemon/PluginManager.cpp @@ -138,6 +138,8 @@ void CPluginManager::LoadPlugins() if (!ext || strcmp(ext + 1, PLUGINS_LIB_EXTENSION) != 0) continue; *ext = '\0'; + if (strncmp(dent->d_name, PLUGINS_LIB_PREFIX, sizeof(PLUGINS_LIB_PREFIX)-1) != 0) + continue; LoadPlugin(dent->d_name + sizeof(PLUGINS_LIB_PREFIX)-1, /*enabled_only:*/ true); } closedir(dir); diff --git a/src/Daemon/RPM.cpp b/src/Daemon/RPM.cpp index 6f05c0b..6cc0ba6 100644 --- a/src/Daemon/RPM.cpp +++ b/src/Daemon/RPM.cpp @@ -4,8 +4,8 @@ CRPM::CRPM() { - char *argv[] = { (char*)"" }; - m_poptContext = rpmcliInit(0, argv, NULL); + static const char *const argv[] = { "", NULL }; + m_poptContext = rpmcliInit(1, (char**)argv, NULL); } CRPM::~CRPM() |
