1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-27 05:20:20 -04:00

Prevent a OOB read when parsing IRCNet ! channels

Make sure the string has enough data.
Fixes #16
This commit is contained in:
LemonBoy 2017-10-19 11:17:56 +02:00
parent 28d0b8c746
commit 45dfe2ba38

View File

@ -37,7 +37,7 @@ static void check_join_failure(IRC_SERVER_REC *server, const char *channel)
channel++; /* server didn't understand !channels */
chanrec = channel_find(SERVER(server), channel);
if (chanrec == NULL && channel[0] == '!') {
if (chanrec == NULL && channel[0] == '!' && strlen(channel) > 6) {
/* it probably replied with the full !channel name,
find the channel with the short name.. */
chan2 = g_strdup_printf("!%s", channel+6);