From f271f15048870abae581819bf74685e3037fedcb66194cbcf43c62d888b357c5 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 12 Oct 2021 19:35:59 +0000 Subject: [PATCH] Accepting request 924944 from home:expeehaa:branches:network:pidgin - Add pidgin-fix-double-free-crash.patch: fix double free crash OBS-URL: https://build.opensuse.org/request/show/924944 OBS-URL: https://build.opensuse.org/package/show/network:pidgin/pidgin?expand=0&rev=52 --- pidgin-fix-double-free-crash.patch | 48 ++++++++++++++++++++++++++++++ pidgin.changes | 5 ++++ pidgin.spec | 3 ++ 3 files changed, 56 insertions(+) create mode 100644 pidgin-fix-double-free-crash.patch diff --git a/pidgin-fix-double-free-crash.patch b/pidgin-fix-double-free-crash.patch new file mode 100644 index 0000000..4c44423 --- /dev/null +++ b/pidgin-fix-double-free-crash.patch @@ -0,0 +1,48 @@ +# HG changeset patch +# User Gary Kramlich +# Date 1632457638 18000 +# Thu Sep 23 23:27:18 2021 -0500 +# Branch release-2.x.y +# Node ID 740dafa46e5ea6a00f031ec39c76d38ad1b11172 +# Parent e91465803c0e9e21de809dfcf8f8ab0f547cc269 +Fix a double free in jabber/message.c and silence a warning + +JabberBuddyResource is handled internally, but it's free function, which is static, does in fact free the thread_id as well. + +Testing Done: +Compiled + +Bugs closed: PIDGIN-17547 + +Reviewed at https://reviews.imfreedom.org/r/932/ + +diff --git a/libpurple/protocols/jabber/message.c b/libpurple/protocols/jabber/message.c +--- a/libpurple/protocols/jabber/message.c ++++ b/libpurple/protocols/jabber/message.c +@@ -798,7 +798,7 @@ + case JABBER_MESSAGE_OTHER: + purple_debug_info("jabber", + "Received message of unknown type: %s\n", type); +- /* Fall-through is intentional */ ++ /* FALL-THROUGH */ + case JABBER_MESSAGE_NORMAL: + case JABBER_MESSAGE_CHAT: + handle_chat(jm); +@@ -1179,12 +1179,13 @@ + jm->id = jabber_get_next_id(jm->js); + + if(jbr) { +- if(jbr->thread_id) +- jm->thread_id = jbr->thread_id; ++ if(jbr->thread_id) { ++ jm->thread_id = g_strdup(jbr->thread_id); ++ } + +- if (jbr->chat_states == JABBER_CHAT_STATES_UNSUPPORTED) ++ if (jbr->chat_states == JABBER_CHAT_STATES_UNSUPPORTED) { + jm->chat_state = JM_STATE_NONE; +- else { ++ } else { + /* if(JABBER_CHAT_STATES_UNKNOWN == jbr->chat_states) + jbr->chat_states = JABBER_CHAT_STATES_UNSUPPORTED; */ + } diff --git a/pidgin.changes b/pidgin.changes index f3a0e3b..78b809f 100644 --- a/pidgin.changes +++ b/pidgin.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Oct 12 16:44:39 UTC 2021 - Lukas Müller + +- Add pidgin-fix-double-free-crash.patch: fix double free crash + ------------------------------------------------------------------- Mon Sep 20 20:19:21 UTC 2021 - Stanislav Brabec diff --git a/pidgin.spec b/pidgin.spec index 0d9776d..f17c88d 100644 --- a/pidgin.spec +++ b/pidgin.spec @@ -38,6 +38,8 @@ Patch2: pidgin-fix-perl-build.patch Patch3: pidgin-use-default-alsa.patch # PATCH-FIX-OPENSUSE pidgin-always-enable-intltool.patch mgorse@suse.com -- always enable intltool, needed for autoconf 2.71. Patch4: pidgin-always-enable-intltool.patch +# Fix a crash due to a freed double. Patch was taken from upstream and will be included in version 2.14.8. +Patch5: pidgin-fix-double-free-crash.patch BuildRequires: ca-certificates-mozilla BuildRequires: doxygen BuildRequires: fdupes @@ -220,6 +222,7 @@ scripts and plugins. %patch3 -p1 %endif %patch4 -p1 +%patch5 -p1 cp -f %{SOURCE3} %{name}-prefs.xml