Permalink
Browse files

Zero memory after nmalloc() to initialize memberlist. Fixes #326

* Call bzero() after nmalloc() when initializing a new channel to properly zero all data since channel_malloc() isn't available.
  • Loading branch information...
1 parent 1fb2777 commit 1017d96721773a730bd980fa62a7ae6e1ef1c523 @vanosg vanosg committed on GitHub Feb 3, 2017
Showing with 5 additions and 3 deletions.
  1. +3 −1 src/mod/channels.mod/tclchan.c
  2. +2 −2 src/patch.h
@@ -1934,7 +1934,9 @@ static void init_channel(struct chanset_t *chan, int reset)
nfree(chan->channel.member);
}
chan->channel.members = 0;
- chan->channel.member = nmalloc(sizeof(memberlist));
+ chan->channel.member = nmalloc(sizeof *chan->channel.member);
+ /* Since we don't have channel_malloc, manually bzero */
+ egg_bzero(chan->channel.member, sizeof *chan->channel.member);
chan->channel.member->nick[0] = 0;
chan->channel.member->next = NULL;
}
View
@@ -39,12 +39,12 @@ patch("Git"); /* Git version */
*
*
*/
-patch("1485620062"); /* current unixtime */
+patch("1486095498"); /* current unixtime */
/*
*
*
*/
-patch("detectssl");
+patch("channelinit");
/*
*
*

0 comments on commit 1017d96

Please sign in to comment.