summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2017-02-14 13:38:59 +0100
committerLemonBoy <thatlemon@gmail.com>2017-02-14 14:46:14 +0100
commit98ead50b4eea7cda4b357f1c4b19a741205c6fa4 (patch)
tree48e88298be098ae9d987fefb898219b87f29535f /src/fe-common
parent228f487a69cc032b368a0ae0daea6796b7d10d6e (diff)
downloadirssi-98ead50b4eea7cda4b357f1c4b19a741205c6fa4.zip
Prevent some potential null-pointer deferences.
Spotted by our friend scan-build.
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/fe-channels.c2
-rw-r--r--src/fe-common/irc/fe-netsplit.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/fe-common/core/fe-channels.c b/src/fe-common/core/fe-channels.c
index 00aac885..8e434ab5 100644
--- a/src/fe-common/core/fe-channels.c
+++ b/src/fe-common/core/fe-channels.c
@@ -453,7 +453,7 @@ static void display_sorted_nicks(CHANNEL_REC *channel, GSList *nicklist)
}
}
- if (str->len > strlen(prefix_format)) {
+ if (prefix_format != NULL && str->len > strlen(prefix_format)) {
printtext(channel->server, channel->visible_name,
MSGLEVEL_CLIENTCRAP, "%s", str->str);
}
diff --git a/src/fe-common/irc/fe-netsplit.c b/src/fe-common/irc/fe-netsplit.c
index 17fb1994..4c69dd10 100644
--- a/src/fe-common/irc/fe-netsplit.c
+++ b/src/fe-common/irc/fe-netsplit.c
@@ -148,6 +148,8 @@ static void print_server_splits(IRC_SERVER_REC *server, TEMP_SPLIT_REC *rec, con
char *sourceserver;
GSList *tmp;
+ g_return_if_fail(rec->servers != NULL);
+
destservers = g_string_new(NULL);
for (tmp = rec->servers; tmp != NULL; tmp = tmp->next) {
NETSPLIT_SERVER_REC *rec = tmp->data;