From 1f9c560a7408bf5550e030b5ac0c07dad5435eb1 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Fri, 15 May 2009 11:54:33 +0000 Subject: [PATCH] Fix out of bounds access in event_wallops(). bug #662 Submitted by: nemo git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5068 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/irc/fe-events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fe-common/irc/fe-events.c b/src/fe-common/irc/fe-events.c index f834f8af..a6fd8599 100644 --- a/src/fe-common/irc/fe-events.c +++ b/src/fe-common/irc/fe-events.c @@ -298,7 +298,7 @@ static void event_wallops(IRC_SERVER_REC *server, const char *data, const char * tmp = g_strdup(data+8); len = strlen(tmp); - if (tmp[len-1] == 1) tmp[len-1] = '\0'; + if (len >= 1 && tmp[len-1] == 1) tmp[len-1] = '\0'; printformat(server, NULL, MSGLEVEL_WALLOPS, IRCTXT_ACTION_WALLOPS, nick, tmp); g_free(tmp); }