- Add upstream fix for twitter protocol segfault (http://bugs.bitlbee.org/bitlbee/ticket/650)

Submitted by:  ashish@
This commit is contained in:
Henrik Brix Andersen 2010-07-26 12:26:58 +00:00
parent 3c1991f7d2
commit cd32ba84b9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=258277
2 changed files with 38 additions and 0 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= bitlbee
PORTVERSION= 1.2.8
PORTREVISION= 1
CATEGORIES= irc
MASTER_SITES= http://get.bitlbee.org/src/ \
${MASTER_SITE_LOCAL}

View File

@ -0,0 +1,37 @@
--- protocols/twitter/twitter_lib.c.orig 2010-07-04 17:26:16.000000000 +0000
+++ protocols/twitter/twitter_lib.c 2010-07-26 11:39:17.000000000 +0000
@@ -65,6 +65,8 @@ static void twitter_groupchat_init(struc
*/
static void txu_free(struct twitter_xml_user *txu)
{
+ if (txu == NULL)
+ return;
g_free(txu->name);
g_free(txu->screen_name);
g_free(txu);
@@ -88,6 +90,8 @@ static void txs_free(struct twitter_xml_
static void txl_free(struct twitter_xml_list *txl)
{
GSList *l;
+ if (txl == NULL)
+ return;
for ( l = txl->list; l ; l = g_slist_next(l) )
if (txl->type == TXL_STATUS)
txs_free((struct twitter_xml_status *)l->data);
@@ -472,6 +476,9 @@ static void twitter_groupchat(struct im_
for ( l = list; l ; l = g_slist_next(l) )
{
status = l->data;
+ if (status->user == NULL || status->text == NULL)
+ continue;
+
twitter_add_buddy(ic, status->user->screen_name, status->user->name);
strip_html(status->text);
@@ -735,4 +742,4 @@ void twitter_friendships_create_destroy(
args[0] = "screen_name";
args[1] = who;
twitter_http(ic, create ? TWITTER_FRIENDSHIPS_CREATE_URL : TWITTER_FRIENDSHIPS_DESTROY_URL, twitter_http_post, ic, 1, args, 2);
-}
\ No newline at end of file
+}