mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-10 18:23:12 +02:00
reported by Ablom2008 and mist26.
This commit is contained in:
@@ -1691,3 +1691,5 @@
|
||||
- Fix NAMES with UHNAMES support, screwed it up at 'Win32 compile fixes' a
|
||||
few lines up...
|
||||
- Fix OOB read caused by UHNAMES support.
|
||||
- Added some countermeasures against crash-on-boot, #0003725 and #0003653,
|
||||
reported by Ablom2008 and mist26.
|
||||
|
||||
+3
-1
@@ -1599,6 +1599,8 @@ char *encoded;
|
||||
}
|
||||
|
||||
encoded = unreal_encodespace(SPAMFILTER_BAN_REASON);
|
||||
if (!encoded)
|
||||
abort(); /* hack to trace 'impossible' bug... */
|
||||
for (tk = tklines[tkl_hash('q')]; tk; tk = tk->next)
|
||||
{
|
||||
if (tk->type != TKL_NICK)
|
||||
@@ -5610,7 +5612,7 @@ int _conf_spamfilter(ConfigFile *conf, ConfigEntry *ce)
|
||||
nl->ptr.spamf = unreal_buildspamfilter(word);
|
||||
nl->ptr.spamf->action = action;
|
||||
|
||||
if (has_reason)
|
||||
if (has_reason && reason)
|
||||
nl->ptr.spamf->tkl_reason = strdup(unreal_encodespace(reason));
|
||||
else
|
||||
nl->ptr.spamf->tkl_reason = strdup("<internally added by ircd>");
|
||||
|
||||
@@ -1073,6 +1073,10 @@ static char buf[512], *i, *o;
|
||||
char *unreal_encodespace(char *s)
|
||||
{
|
||||
static char buf[512], *i, *o;
|
||||
|
||||
if (!s)
|
||||
return NULL; /* NULL in = NULL out */
|
||||
|
||||
for (i = s, o = buf; (*i) && (o < buf+509); i++)
|
||||
{
|
||||
if (*i == ' ')
|
||||
|
||||
Reference in New Issue
Block a user