# HG changeset patch # User Paul Aurich # Date 1241715899 0 # Node ID 33f98d662db81e6000a482bbc0fa0003ec432930 # Parent b0f61cb90f62e34ecec36e309c29b93c7a494619 Don't crash when resource is NULL. Thanks, Marcus! #0 0x00007ffe6d203a92 in strcmp () from /lib/libc.so.6 #1 0x00007ffe5c588406 in jabber_buddy_find_resource ( jb=, resource=0x1
) at buddy.c:143 #2 0x00007ffe5c5a7303 in jabber_presence_set_capabilities (info=0x0, exts=0x0, userdata=0x11da700) at presence.c:410 diff -r b0f61cb90f62 -r 33f98d662db8 libpurple/protocols/jabber/presence.c --- a/libpurple/protocols/jabber/presence.c Thu May 07 05:23:15 2009 +0000 +++ b/libpurple/protocols/jabber/presence.c Thu May 07 17:04:59 2009 +0000 @@ -404,8 +404,10 @@ JabberPresenceCapabilities *userdata) { JabberBuddyResource *jbr; - char *resource = g_utf8_strrchr(userdata->from, -1, '/'); - resource += 1; + char *resource = g_utf8_strchr(userdata->from, -1, '/'); + + if (resource) + resource += 1; jbr = jabber_buddy_find_resource(userdata->jb, resource); if (!jbr) {