xC: more precise capability whitelisting
It could theoretically match on more entries than intended.
This commit is contained in:
@@ -7187,7 +7187,8 @@ irc_process_cap_ls (struct server *s)
|
||||
const char *cap = s->cap_ls_buf.vector[i];
|
||||
size_t cap_name_len = strcspn (cap, "=");
|
||||
for (size_t k = 0; k < use.len; k++)
|
||||
if (!strncasecmp_ascii (use.vector[k], cap, cap_name_len))
|
||||
if (!strncasecmp_ascii (use.vector[k], cap, cap_name_len)
|
||||
&& strchr ("=\0", use.vector[k][cap_name_len]))
|
||||
strv_append_owned (&chosen, xstrndup (cap, cap_name_len));
|
||||
}
|
||||
strv_reset (&s->cap_ls_buf);
|
||||
|
||||
Reference in New Issue
Block a user