From cf1e46b34c1ec3566765d40cde5c73cf7ac2d8c3 Mon Sep 17 00:00:00 2001 From: jgeboski Date: Sat, 24 Jan 2015 00:26:41 -0500 Subject: 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. --- facebook/facebook.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'facebook') 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; -- cgit v1.2.3