aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Podgorny <pasis.ua@gmail.com>2013-03-12 21:49:10 +0200
committerDmitry Podgorny <pasis.ua@gmail.com>2013-03-12 21:49:10 +0200
commit1de8394af62bac1e4e0354267b949c1187ea3d2c (patch)
tree4686a51b90acac7f01c3bcf5ce1fb85e23a1f32a
parent918e690ade143b4e2019e54f04d71d7c75c19c68 (diff)
downloadprofanity-1de8394af62bac1e4e0354267b949c1187ea3d2c.tar.gz
profanity-1de8394af62bac1e4e0354267b949c1187ea3d2c.tar.xz
net-im/profanity-0.2.0: added patch
added profanity-0.2.0-fix-strdup.patch that fixes a crash when join to a conference.
-rw-r--r--net-im/profanity/files/profanity-0.2.0-fix-strdup.patch45
-rw-r--r--net-im/profanity/profanity-0.2.0.ebuild6
2 files changed, 51 insertions, 0 deletions
diff --git a/net-im/profanity/files/profanity-0.2.0-fix-strdup.patch b/net-im/profanity/files/profanity-0.2.0-fix-strdup.patch
new file mode 100644
index 0000000..b36db3a
--- /dev/null
+++ b/net-im/profanity/files/profanity-0.2.0-fix-strdup.patch
@@ -0,0 +1,45 @@
+diff --git a/src/xmpp/connection.h b/src/xmpp/connection.h
+index 3c0c1bf..b570125 100644
+--- a/src/xmpp/connection.h
++++ b/src/xmpp/connection.h
+@@ -25,6 +25,8 @@
+
+ #include <strophe.h>
+
++#include "resource.h"
++
+ xmpp_conn_t *connection_get_conn(void);
+ xmpp_ctx_t *connection_get_ctx(void);
+ int connection_error_handler(xmpp_conn_t * const conn,
+diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c
+index 8e02343..4ee3bad 100644
+--- a/src/xmpp/stanza.c
++++ b/src/xmpp/stanza.c
+@@ -27,6 +27,7 @@
+ #include <strophe.h>
+
+ #include "common.h"
++#include "xmpp/connection.h"
+ #include "xmpp/stanza.h"
+ #include "xmpp/capabilities.h"
+
+@@ -562,6 +563,7 @@ DataForm *
+ stanza_create_form(xmpp_stanza_t * const stanza)
+ {
+ DataForm *result = NULL;
++ xmpp_ctx_t *ctx = connection_get_ctx();
+
+ xmpp_stanza_t *child = xmpp_stanza_get_children(stanza);
+
+@@ -591,7 +593,10 @@ stanza_create_form(xmpp_stanza_t * const stanza)
+ // handle values
+ while (value != NULL) {
+ char *text = xmpp_stanza_get_text(value);
+- field->values = g_slist_insert_sorted(field->values, strdup(text), (GCompareFunc)octet_compare);
++ if (text != NULL) {
++ field->values = g_slist_insert_sorted(field->values, strdup(text), (GCompareFunc)octet_compare);
++ xmpp_free(ctx, text);
++ }
+ value = xmpp_stanza_get_next(value);
+ }
+
diff --git a/net-im/profanity/profanity-0.2.0.ebuild b/net-im/profanity/profanity-0.2.0.ebuild
index 3e8fc80..c1060b2 100644
--- a/net-im/profanity/profanity-0.2.0.ebuild
+++ b/net-im/profanity/profanity-0.2.0.ebuild
@@ -4,6 +4,8 @@
EAPI=4
+inherit eutils
+
DESCRIPTION="Ncurses based jabber client inspired by irssi"
HOMEPAGE="http://www.profanity.im/"
SRC_URI="http://www.profanity.im/${P}.tar.gz"
@@ -22,6 +24,10 @@ RDEPEND="dev-libs/glib:2
libnotify? ( x11-libs/libnotify )"
DEPEND="${RDEPEND}"
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-fix-strdup.patch
+}
+
src_configure() {
econf $(use_with xml libxml2)
}