From 38ff846b14f1d1f80983a0818b9bcf60581a2a34 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 24 Jun 2010 02:06:49 +0100 Subject: Fixed an access-after-free() bug in the Jabber keepalive + cache cleanup code. --- protocols/jabber/jabber.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'protocols') diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 48b8ac43..75351d0d 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -473,7 +473,8 @@ static void jabber_chat_invite_( struct groupchat *c, char *who, char *msg ) static void jabber_keepalive( struct im_connection *ic ) { /* Just any whitespace character is enough as a keepalive for XMPP sessions. */ - jabber_write( ic, "\n", 1 ); + if( !jabber_write( ic, "\n", 1 ) ) + return; /* This runs the garbage collection every minute, which means every packet is in the cache for about a minute (which should be enough AFAIK). */ -- cgit v1.2.3