1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-10 03:03:12 +02:00

ident_lookup: reject spaces and control characters early.

...even though in m_nick there is code so it never gets into
sptr->user->username.
This commit is contained in:
Bram Matthys
2019-09-13 19:37:28 +02:00
parent 9b14970c2a
commit f1f0acdd25
+2 -2
View File
@@ -221,11 +221,11 @@ static char *ident_lookup_parse(Client *acptr, char *buf)
/* Username */
// A) Skip any ~ or ^ at the start
for (; *buf; buf++)
if (!strchr("~^", *buf))
if (!strchr("~^", *buf) && (*buf > 32))
break;
// B) Stop at the end, IOTW stop at newline, space, etc.
for (p=buf; *p; p++)
if (strchr("\n\r@: ", *p))
if (strchr("\n\r@:", *p) || (*p <= 32))
{
*p = '\0';
break;