aboutsummaryrefslogtreecommitdiffstats
path: root/facebook/facebook.c
diff options
context:
space:
mode:
authorjgeboski <jgeboski@gmail.com>2015-01-24 00:26:41 -0500
committerjgeboski <jgeboski@gmail.com>2015-01-24 00:26:41 -0500
commitcf1e46b34c1ec3566765d40cde5c73cf7ac2d8c3 (patch)
tree937d77dce33c02a732232ff9b90539932e398f31 /facebook/facebook.c
parent43788598338ef276d41040253cb0a903fd1fadb1 (diff)
downloadbitlbee-facebook-cf1e46b34c1ec3566765d40cde5c73cf7ac2d8c3.tar.gz
bitlbee-facebook-cf1e46b34c1ec3566765d40cde5c73cf7ac2d8c3.tar.bz2
bitlbee-facebook-cf1e46b34c1ec3566765d40cde5c73cf7ac2d8c3.tar.xz
facebook: ensure the account is online with root commands
Currently, it is just assumed that the account is online, however, this is not always the case. If one of the root commands attempts to act on an offline account, it will typically lead to a segmentation fault. To guard against this, an additional check must be added to ensure the account is actually online.
Diffstat (limited to 'facebook/facebook.c')
-rw-r--r--facebook/facebook.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/facebook/facebook.c b/facebook/facebook.c
index ce49eeb..113277d 100644
--- a/facebook/facebook.c
+++ b/facebook/facebook.c
@@ -732,6 +732,11 @@ static account_t *fb_cmd_account(irc_t *irc, char **args)
return NULL;
}
+ if (acc->ic == NULL) {
+ irc_rootmsg(irc, "Account not online: %s", acc->tag);
+ return NULL;
+ }
+
if (g_ascii_strcasecmp(acc->prpl->name, "facebook") != 0) {
irc_rootmsg(irc, "Unknown Facebook account: %s", acc->tag);
return NULL;