mirror of
https://github.com/weechat/weechat.git
synced 2026-07-09 11:13:12 +02:00
irc: fix crash when a new message 005 is received with longer nick prefixes
Thanks to Stuart Nevans Locke for reporting the issue.
This commit is contained in:
@@ -988,11 +988,14 @@ irc_server_set_prefix_modes_chars (struct t_irc_server *server,
|
||||
const char *prefix)
|
||||
{
|
||||
char *pos;
|
||||
int i, length_modes, length_chars;
|
||||
int i, old_length_chars, length_modes, length_chars;
|
||||
|
||||
if (!server || !prefix)
|
||||
return;
|
||||
|
||||
old_length_chars = (server->prefix_chars) ?
|
||||
strlen (server->prefix_chars) : 0;
|
||||
|
||||
/* free previous values */
|
||||
if (server->prefix_modes)
|
||||
{
|
||||
@@ -1032,6 +1035,10 @@ irc_server_set_prefix_modes_chars (struct t_irc_server *server,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
length_chars = (server->prefix_chars) ? strlen (server->prefix_chars) : 0;
|
||||
if (server->prefix_chars && (length_chars != old_length_chars))
|
||||
irc_nick_realloc_prefixes (server, old_length_chars, length_chars);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user