summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAnton Arapov <aarapov@redhat.com>2009-08-10 17:40:08 +0200
committerAnton Arapov <aarapov@redhat.com>2009-08-10 17:40:08 +0200
commit6cb98fb02176d0a24474d9843f2648b7ed824a31 (patch)
tree7665fa2ab3bd3375673e0a31f01909f80cd468e6 /lib
parentc9e10d9e86fc1d6870374391b1d5c645150b1c05 (diff)
downloadabrt-6cb98fb02176d0a24474d9843f2648b7ed824a31.tar.gz
abrt-6cb98fb02176d0a24474d9843f2648b7ed824a31.tar.xz
abrt-6cb98fb02176d0a24474d9843f2648b7ed824a31.zip
fix a bug where kerneloops segfaults on empty oops data
also, we aren't interested in empty reports, so do not report anything when oops message was not provided. Signed-off-by: Anton Arapov <aarapov@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Plugins/KerneloopsReporter.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/Plugins/KerneloopsReporter.cpp b/lib/Plugins/KerneloopsReporter.cpp
index a839b5b0..acf8f42c 100644
--- a/lib/Plugins/KerneloopsReporter.cpp
+++ b/lib/Plugins/KerneloopsReporter.cpp
@@ -96,13 +96,23 @@ CKerneloopsReporter::CKerneloopsReporter() :
void CKerneloopsReporter::Report(const map_crash_report_t& pCrashReport, const std::string& pArgs)
{
+ int ret = -1;
+ map_crash_report_t::const_iterator it;
+
comm_layer_inner_status("Creating and submitting a report...");
- /* TODO: react on errorcode (!0 -> error) */
- http_post_to_kerneloops_site(
- m_sSubmitURL.c_str(),
- pCrashReport.find(FILENAME_KERNELOOPS)->second[CD_CONTENT].c_str()
- );
+ it = pCrashReport.begin();
+ it = pCrashReport.find(FILENAME_KERNELOOPS);
+ if (it != pCrashReport.end()) {
+ ret = http_post_to_kerneloops_site(
+ m_sSubmitURL.c_str(),
+ it->second[CD_CONTENT].c_str()
+ );
+ }
+
+ if (ret)
+ /* FIXME: be more informative */
+ comm_layer_inner_status("Report has not been sent...");
}
void CKerneloopsReporter::LoadSettings(const std::string& pPath)