mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 14:26:39 +02:00
irc: fix some malloc sizes
This commit is contained in:
@@ -2475,8 +2475,8 @@ irc_command_kickban (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
/* set ban for nick(+host) on channel */
|
||||
if (strchr (pos_nick, '@'))
|
||||
{
|
||||
length = strlen (pos_nick) + 16;
|
||||
mask = malloc (length + 1);
|
||||
length = strlen (pos_nick) + 16 + 1;
|
||||
mask = malloc (length);
|
||||
if (mask)
|
||||
{
|
||||
pos = strchr (pos_nick, '!');
|
||||
|
||||
@@ -431,8 +431,8 @@ irc_completion_channel_topic_cb (void *data, const char *completion_item,
|
||||
* instead of
|
||||
* /topic #test is a test channel
|
||||
*/
|
||||
length = strlen (ptr_channel->name) + strlen (ptr_channel->topic) + 16;
|
||||
topic = malloc (length + 1);
|
||||
length = strlen (ptr_channel->name) + strlen (ptr_channel->topic) + 16 + 1;
|
||||
topic = malloc (length);
|
||||
if (topic)
|
||||
{
|
||||
snprintf (topic, length, "%s %s",
|
||||
|
||||
Reference in New Issue
Block a user