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

- Added some countermeasures against crash-on-boot, #0003725 and #0003653,

reported by Ablom2008 and mist26.
This commit is contained in:
Bram Matthys
2008-12-22 16:17:17 +00:00
parent cdd38d79f4
commit 5daa5216ac
3 changed files with 9 additions and 1 deletions
+2
View File
@@ -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
View File
@@ -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>");
+4
View File
@@ -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 == ' ')