From 6b23b98ab6675ae5371fcce47976dfed00e052cd Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 28 Feb 2016 18:49:29 -0600 Subject: [PATCH] m_cap: ensure buffers are initialized properly --- modules/m_cap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/m_cap.c b/modules/m_cap.c index 1c1a4012..877653d7 100644 --- a/modules/m_cap.c +++ b/modules/m_cap.c @@ -146,8 +146,8 @@ clicap_find(const char *data, int *negate, int *finished) static void clicap_generate(struct Client *source_p, const char *subcmd, int flags, int clear) { - char buf[BUFSIZE]; - char capbuf[BUFSIZE]; + char buf[BUFSIZE] = { 0 }; + char capbuf[BUFSIZE] = { 0 }; char *p; int buflen = 0; int curlen, mlen; @@ -206,8 +206,10 @@ clicap_generate(struct Client *source_p, const char *subcmd, int flags, int clea *p = '\0'; sendto_one(source_p, "%s * :%s", buf, capbuf); + p = capbuf; buflen = mlen; + memset(capbuf, 0, sizeof capbuf); } if(clear)