From faed3f4735bb4e433bbd655c846d2e558e71e492 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 19 Nov 2009 15:56:20 +0100 Subject: fix small bug where we use value first and *then* check for its validity Signed-off-by: Denys Vlasenko --- src/Daemon/MiddleWare.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Daemon/MiddleWare.cpp') diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index bbbca0a..f3c6bdf 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -380,12 +380,17 @@ static bool CheckReport(const map_crash_report_t& pCrashReport) map_crash_report_t::const_iterator end = pCrashReport.end(); + if (it_package == end) + { + return false; + } + // FIXME: bypass the test if it's kerneloops if (it_package->second[CD_CONTENT] == "kernel") return true; if (it_analyzer == end || it_mwuid == end || - it_mwuuid == end || it_package == end || + it_mwuuid == end || /* it_package == end || */ it_architecture == end || it_kernel == end || it_component == end || it_release == end || it_executable == end) -- cgit