diff options
author | Anton Arapov <aarapov@redhat.com> | 2009-08-10 17:40:08 +0200 |
---|---|---|
committer | Anton Arapov <aarapov@redhat.com> | 2009-08-10 17:40:08 +0200 |
commit | 6cb98fb02176d0a24474d9843f2648b7ed824a31 (patch) | |
tree | 7665fa2ab3bd3375673e0a31f01909f80cd468e6 /lib | |
parent | c9e10d9e86fc1d6870374391b1d5c645150b1c05 (diff) | |
download | abrt-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.cpp | 20 |
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) |