Add null terminator to modes in channelListMode
Otherwise passing more than 13 parameters reads past the end of the array.master
parent
cabe285427
commit
82acea5dfa
|
@ -213,7 +213,9 @@ static void channelListMode(uint id, char pm, char l, const char *params) {
|
||||||
for (const char *ch = params; *ch; ++ch) {
|
for (const char *ch = params; *ch; ++ch) {
|
||||||
if (*ch == ' ') count++;
|
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);
|
ircFormat("MODE %s %c%.*s %s\r\n", idNames[id], pm, count, modes, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue