summaryrefslogtreecommitdiff
path: root/src/xmpp/biboumi_component.cpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-10-06 22:23:04 +0200
committerlouiz’ <louiz@louiz.org>2016-10-06 22:29:47 +0200
commit0049b3e32d1d65acb4314208ddfdd52728d17162 (patch)
tree7de9a5f20172a7ee55f132842d2dac622a69eb73 /src/xmpp/biboumi_component.cpp
parent5477db7999b00cc6525ea964dbd51049b6fa4c00 (diff)
downloadbiboumi-0049b3e32d1d65acb4314208ddfdd52728d17162.tar.gz
biboumi-0049b3e32d1d65acb4314208ddfdd52728d17162.tar.bz2
biboumi-0049b3e32d1d65acb4314208ddfdd52728d17162.tar.xz
biboumi-0049b3e32d1d65acb4314208ddfdd52728d17162.zip
Remove a potential nullptr dereference, on mam queryid
fix coverity CID 153376
Diffstat (limited to 'src/xmpp/biboumi_component.cpp')
-rw-r--r--src/xmpp/biboumi_component.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/xmpp/biboumi_component.cpp b/src/xmpp/biboumi_component.cpp
index b9a8779..49a1fd5 100644
--- a/src/xmpp/biboumi_component.cpp
+++ b/src/xmpp/biboumi_component.cpp
@@ -598,9 +598,8 @@ bool BiboumiComponent::handle_mam_request(const Stanza& stanza)
const auto lines = Database::get_muc_logs(from.bare(), iid.get_local(), iid.get_server(), -1, start, end);
for (const db::MucLogLine& line: lines)
{
- const auto queryid = query->get_tag("queryid");
if (!line.nick.value().empty())
- this->send_archived_message(line, to.full(), from.full(), queryid);
+ this->send_archived_message(line, to.full(), from.full(), query_id);
}
this->send_iq_result_full_jid(id, from.full(), to.full());
return true;
@@ -617,7 +616,8 @@ void BiboumiComponent::send_archived_message(const db::MucLogLine& log_line, con
XmlNode result("result");
result["xmlns"] = MAM_NS;
- result["queryid"] = queryid;
+ if (!queryid.empty())
+ result["queryid"] = queryid;
result["id"] = log_line.uuid.value();
XmlNode forwarded("forwarded");