From 1aa10ece887afd5d64eca1211aeced6cab310680 Mon Sep 17 00:00:00 2001 From: Wouter Coekaerts Date: Sun, 21 Mar 2010 20:23:34 +0000 Subject: [PATCH] Fix crash when checking for fuzzy nick match when not on the channel. Reported by Aurelien Delaitre (SATE 2009) git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5126 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/nicklist.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/nicklist.c b/src/core/nicklist.c index 9f67f20b..c38df6d4 100644 --- a/src/core/nicklist.c +++ b/src/core/nicklist.c @@ -575,9 +575,13 @@ int nick_match_msg(CHANNEL_REC *channel, const char *msg, const char *nick) if (fullmatch) return TRUE; /* matched without fuzzyness */ - /* matched with some fuzzyness .. check if there's an exact match - for some other nick in the same channel. */ - return nick_nfind(channel, msgstart, (int) (msg-msgstart)) == NULL; + if (channel != NULL) { + /* matched with some fuzzyness .. check if there's an exact match + for some other nick in the same channel. */ + return nick_nfind(channel, msgstart, (int) (msg-msgstart)) == NULL; + } else { + return TRUE; + } } void nicklist_init(void)