From 176a1fcdf53f54c92fbc57f49f610bb7c91ec8f4 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Wed, 21 Dec 2016 22:21:36 +0100 Subject: Add some bugfix patches cherry-picked upstream. --- debian/patches/020161125~ad22be4.patch | 38 ++++++++++++++++++++++++++++++++++ debian/patches/020161204~eb8f1cb.patch | 24 +++++++++++++++++++++ debian/patches/series | 2 ++ 3 files changed, 64 insertions(+) create mode 100644 debian/patches/020161125~ad22be4.patch create mode 100644 debian/patches/020161204~eb8f1cb.patch diff --git a/debian/patches/020161125~ad22be4.patch b/debian/patches/020161125~ad22be4.patch new file mode 100644 index 0000000..46013bc --- /dev/null +++ b/debian/patches/020161125~ad22be4.patch @@ -0,0 +1,38 @@ +Description: Do not fail to build if litesql is not there +Origin: upstream, https://lab.louiz.org/louiz/biboumi/commit/ad22be4 +Author: louiz’ +Forwarded: yes +Last-Update: 2016-12-21 + +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -12,7 +12,9 @@ + + #include + #include +-#include ++#ifdef USE_DATABASE ++# include ++#endif + + // A flag set by the SIGINT signal handler. + static std::atomic stop(false); +@@ -83,11 +85,14 @@ + if (hostname.empty()) + return config_help("hostname"); + ++ ++#ifdef USE_DATABASE + try { +- open_database(); +- } catch (const litesql::DatabaseError&) { +- return 1; +- } ++ open_database(); ++ } catch (const litesql::DatabaseError&) { ++ return 1; ++ } ++#endif + + // Block the signals we want to manage. They will be unblocked only during + // the epoll_pwait or ppoll calls. This avoids some race conditions, diff --git a/debian/patches/020161204~eb8f1cb.patch b/debian/patches/020161204~eb8f1cb.patch new file mode 100644 index 0000000..e303cbc --- /dev/null +++ b/debian/patches/020161204~eb8f1cb.patch @@ -0,0 +1,24 @@ +Description: Avoid a potential nullptr dereference +Origin: upstream, https://lab.louiz.org/louiz/biboumi/commit/eb8f1cb +Author: louiz’ +Forwarded: yes +Last-Update: 2016-12-21 + +--- a/src/xmpp/biboumi_component.cpp ++++ b/src/xmpp/biboumi_component.cpp +@@ -570,13 +570,11 @@ + Jid to(stanza.get_tag("to")); + + const XmlNode* query = stanza.get_child("query", MAM_NS); +- std::string query_id; +- if (query) +- query_id = query->get_tag("queryid"); + + Iid iid(to.local, {'#', '&'}); +- if (iid.type == Iid::Type::Channel && to.resource.empty()) ++ if (query && iid.type == Iid::Type::Channel && to.resource.empty()) + { ++ const std::string query_id = query->get_tag("queryid"); + std::string start; + std::string end; + const XmlNode* x = query->get_child("x", DATAFORM_NS); diff --git a/debian/patches/series b/debian/patches/series index 9da3ec6..66f0cf4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,3 @@ +020161125~ad22be4.patch +020161204~eb8f1cb.patch 2001_cmake_ignore_git.patch -- cgit v1.2.3