diff options
author | June McEnroe <june@causal.agency> | 2020-06-15 20:34:28 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-06-15 20:34:28 -0400 |
commit | 82acea5dfa260fa7b4f6257f4502b9a9a2eeabaa (patch) | |
tree | dc3336244c4b46f357b896583f446c3ec883fefb /command.c | |
parent | Document /quote needing /debug for output (diff) | |
download | catgirl-82acea5dfa260fa7b4f6257f4502b9a9a2eeabaa.tar.gz catgirl-82acea5dfa260fa7b4f6257f4502b9a9a2eeabaa.zip |
Add null terminator to modes in channelListMode
Otherwise passing more than 13 parameters reads past the end of the array.
Diffstat (limited to '')
-rw-r--r-- | command.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/command.c b/command.c index ee3801d..90732f3 100644 --- a/command.c +++ b/command.c @@ -213,7 +213,9 @@ static void channelListMode(uint id, char pm, char l, const char *params) { for (const char *ch = params; *ch; ++ch) { if (*ch == ' ') count++; } - char modes[ParamCap - 2] = { l, l, l, l, l, l, l, l, l, l, l, l, l }; + char modes[ParamCap - 2 + 1] = { + l, l, l, l, l, l, l, l, l, l, l, l, l, '\0' + }; ircFormat("MODE %s %c%.*s %s\r\n", idNames[id], pm, count, modes, params); } |