aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-11-01 21:35:20 -0300
committerdequis <dx@dxzone.com.ar>2015-11-01 21:35:20 -0300
commitedc96147e756e1f0aeabde93e1989064fdc9675b (patch)
treeda3a2467d006df2ce335b27bef9e5b82ac2f4bdc
parent55182f5e3dde8d57e5af4c6aa653e1564633614d (diff)
downloadbitlbee-facebook-edc96147e756e1f0aeabde93e1989064fdc9675b.tar.gz
bitlbee-facebook-edc96147e756e1f0aeabde93e1989064fdc9675b.tar.bz2
bitlbee-facebook-edc96147e756e1f0aeabde93e1989064fdc9675b.tar.xz
fb_channel_join: add a null check for the "room" channel setting
Control channels never have a room setting, so joining to &facebook and trying to fbjoin a channel would result in a null pointer dereference in the next line (FB_ID_TO_STR)
-rw-r--r--facebook/facebook.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/facebook/facebook.c b/facebook/facebook.c
index 79fdc94..9084332 100644
--- a/facebook/facebook.c
+++ b/facebook/facebook.c
@@ -48,6 +48,11 @@ fb_channel_join(struct im_connection *ic, FbId tid, const gchar **channel)
}
room = set_getstr(&ich->set, "room");
+
+ if (room == NULL) {
+ continue;
+ }
+
rid = FB_ID_FROM_STR(room);
if (rid != tid) {