summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2015-11-22 16:57:45 +0100
committerLemonBoy <thatlemon@gmail.com>2015-11-22 17:20:00 +0100
commit8701cbc972955ba7522390988e3c0e0c62770fa4 (patch)
tree6af7f32377e45ab8ce72f12ff56e5d54377b5d2e /src/core
parentfbb838b3b0d30ee41de648d667fa89a2d6b41076 (diff)
downloadirssi-8701cbc972955ba7522390988e3c0e0c62770fa4.zip
Let ignore_check do its work when server is NULL
A NULL-check has been added to the ignore_match_server macro, making the function safe from a pointer perspective. Fixes #193 in the meanwhile.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ignore.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/ignore.c b/src/core/ignore.c
index e70b741b..fd3c8a38 100644
--- a/src/core/ignore.c
+++ b/src/core/ignore.c
@@ -97,8 +97,8 @@ static int ignore_match_pattern(IGNORE_REC *rec, const char *text)
match_wildcards((rec)->mask, nick)))
#define ignore_match_server(rec, server) \
- ((rec)->servertag == NULL || \
- g_ascii_strcasecmp((server)->tag, (rec)->servertag) == 0)
+ ((rec)->servertag == NULL || ((server) != NULL && \
+ g_ascii_strcasecmp((server)->tag, (rec)->servertag) == 0))
#define ignore_match_channel(rec, channel) \
((rec)->channels == NULL || ((channel) != NULL && \
@@ -135,7 +135,6 @@ int ignore_check(SERVER_REC *server, const char *nick, const char *host,
char *nickmask;
int len, best_mask, best_match, best_patt;
- g_return_val_if_fail(server != NULL, 0);
if (nick == NULL) nick = "";
chanrec = server == NULL || channel == NULL ? NULL :