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

Reject bans with ASCII < 32. There's no reason to allow these..

This commit is contained in:
Bram Matthys
2015-07-29 18:44:39 +02:00
parent 13089a6958
commit ebc61fe603
+7 -2
View File
@@ -882,7 +882,7 @@ char *trim_str(char *str, int len)
*/
char *clean_ban_mask(char *mask, int what, aClient *cptr)
{
char *cp;
char *cp, *x;
char *user;
char *host;
Extban *p;
@@ -891,11 +891,16 @@ char *clean_ban_mask(char *mask, int what, aClient *cptr)
if (cp)
*cp = '\0';
/* Strip any ':' at beginning coz that desynchs clients/banlists */
/* Strip any ':' at beginning since that would cause a desynch */
for (; (*mask && (*mask == ':')); mask++);
if (!*mask)
return NULL;
/* Forbid ASCII < 32 in all bans */
for (x = mask; *x; x++)
if (*x < ' ')
return NULL;
/* Extended ban? */
if ((*mask == '~') && mask[1] && (mask[2] == ':'))
{