summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes3
-rw-r--r--src/actions.c24
-rw-r--r--src/botserv.c7
-rw-r--r--src/channels.c8
-rw-r--r--src/chanserv.c113
-rw-r--r--src/hostserv.c8
-rw-r--r--src/init.c23
-rw-r--r--src/language.c12
-rw-r--r--src/memoserv.c7
-rw-r--r--src/messages.c8
-rw-r--r--src/misc.c26
-rw-r--r--src/modules.c4
-rw-r--r--src/nickserv.c53
-rw-r--r--src/operserv.c48
-rw-r--r--src/rageircd.c1
-rw-r--r--src/unreal32.c5
-rw-r--r--src/users.c6
-rw-r--r--version.log6
18 files changed, 307 insertions, 55 deletions
diff --git a/Changes b/Changes
index 0f000db0c..35f03881a 100644
--- a/Changes
+++ b/Changes
@@ -27,7 +27,8 @@ Provided by Trystan <trystan@nomadirc.net> - 2004
09/07 A Ircd CHANMODE now trapped and stored. [ #00]
08/23 A New protocol independent design (aka anope-capab). [ #00]
08/28 A New IRCD document for adding new ircd support to new design. [ #00]
-10/07 F Fixed TSMODE ircds that don't stay this in their CAPABA [ #00]
+10/09 F Lots of code clean up to prevent segfaults [ #00]
+10/07 F Fixed TSMODE ircds that don't stay this in their CAPAB [ #00]
10/05 F Cleaned up how OS/CS CLEAR MODES works [ #00]
09/27 F Verbose message for vident. [#173]
09/27 F Check and trap for forbidden nicks on HS. [#172]
diff --git a/src/actions.c b/src/actions.c
index a0750ed00..e7ccc55e8 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -175,8 +175,15 @@ void common_svsmode(User * u, char *modes, char *arg)
char *common_get_vhost(User * u)
{
- if (u->mode & ircd->vhostmode) {
- return u->vhost;
+ if (!u) {
+ return NULL;
+ }
+ if (ircd->vhostmode) {
+ if (u->mode & ircd->vhostmode) {
+ return u->vhost;
+ } else {
+ return u->host;
+ }
} else {
return u->host;
}
@@ -186,9 +193,16 @@ char *common_get_vhost(User * u)
char *common_get_vident(User * u)
{
- if (u->mode & ircd->vhostmode) {
- if (u->vident) {
- return u->vident;
+ if (!u) {
+ return NULL;
+ }
+ if (ircd->vhostmode) {
+ if (u->mode & ircd->vhostmode) {
+ if (u->vident) {
+ return u->vident;
+ } else {
+ return u->username;
+ }
} else {
return u->username;
}
diff --git a/src/botserv.c b/src/botserv.c
index e9264dde7..bc35c5101 100644
--- a/src/botserv.c
+++ b/src/botserv.c
@@ -739,6 +739,13 @@ BotInfo *makebot(char *nick)
{
BotInfo *bi;
+ if (!nick) {
+ if (debug) {
+ alog("debug: makebot called with NULL values");
+ }
+ return NULL;
+ }
+
bi = scalloc(sizeof(BotInfo), 1);
bi->nick = sstrdup(nick);
bi->lastmsg = time(NULL);
diff --git a/src/channels.c b/src/channels.c
index c1510fe7f..b331f6c31 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -955,6 +955,14 @@ void do_topic(const char *source, int ac, char **av)
void add_ban(Channel * chan, char *mask)
{
+ /* check for NULL values otherwise we will segfault */
+ if (!chan || !mask) {
+ if (debug) {
+ alog("debug: add_ban called with NULL values");
+ }
+ return;
+ }
+
if (s_BotServ && BSSmartJoin && chan->ci && chan->ci->bi
&& chan->usercount >= BSMinUsers) {
char botmask[BUFSIZE];
diff --git a/src/chanserv.c b/src/chanserv.c
index bddb03483..64c092c1f 100644
--- a/src/chanserv.c
+++ b/src/chanserv.c
@@ -1248,6 +1248,13 @@ void check_modes(Channel * c)
CBModeInfo *cbmi;
CBMode *cbm;
+ if (!c) {
+ if (debug) {
+ alog("debug: check_modes called with NULL values");
+ }
+ return;
+ }
+
if (c->bouncy_modes)
return;
@@ -1369,7 +1376,7 @@ void check_modes(Channel * c)
int check_valid_admin(User * user, Channel * chan, int servermode)
{
- if (!chan->ci)
+ if (!chan || !chan->ci)
return 1;
if (!ircd->admin) {
@@ -1404,7 +1411,7 @@ int check_valid_admin(User * user, Channel * chan, int servermode)
int check_valid_op(User * user, Channel * chan, int servermode)
{
- if (!chan->ci)
+ if (!chan || !chan->ci)
return 1;
/* They will be kicked; no need to deop, no need to update our internal struct too */
@@ -1774,6 +1781,13 @@ int check_topiclock(Channel * c, time_t topic_time)
{
ChannelInfo *ci;
+ if (!c) {
+ if (debug) {
+ alog("debug: check_topiclock called with NULL values");
+ }
+ return 0;
+ }
+
if (!(ci = c->ci) || !(ci->flags & CI_TOPICLOCK))
return 0;
@@ -2005,7 +2019,16 @@ int check_access(User * user, ChannelInfo * ci, int what)
void alpha_insert_chan(ChannelInfo * ci)
{
ChannelInfo *ptr, *prev;
- char *chan = ci->name;
+ char *chan;
+
+ if (!ci) {
+ if (debug) {
+ alog("debug: alpha_insert_chan called with NULL values");
+ }
+ return;
+ }
+
+ chan = ci->name;
for (prev = NULL, ptr = chanlists[tolower(chan[1])];
ptr != NULL && stricmp(ptr->name, chan) < 0;
@@ -2050,7 +2073,16 @@ static ChannelInfo *makechan(const char *chan)
int delchan(ChannelInfo * ci)
{
int i;
- NickCore *nc = ci->founder;
+ NickCore *nc;
+
+ if (!ci) {
+ if (debug) {
+ alog("debug: delchan called with NULL values");
+ }
+ return 0;
+ }
+
+ nc = ci->founder;
if (debug >= 2) {
alog("debug: delchan removing %s", ci->name);
@@ -2182,6 +2214,13 @@ void reset_levels(ChannelInfo * ci)
{
int i;
+ if (!ci) {
+ if (debug) {
+ alog("debug: reset_levels called with NULL values");
+ }
+ return;
+ }
+
if (ci->levels)
free(ci->levels);
ci->levels = scalloc(CA_SIZE * sizeof(*ci->levels), 1);
@@ -2195,6 +2234,10 @@ void reset_levels(ChannelInfo * ci)
int is_founder(User * user, ChannelInfo * ci)
{
+ if (!user || !ci) {
+ return 0;
+ }
+
if (user->isSuperAdmin) {
return 1;
}
@@ -2249,6 +2292,10 @@ ChanAccess *get_access_entry(NickCore * nc, ChannelInfo * ci)
ChanAccess *access;
int i;
+ if (!ci || !nc) {
+ return NULL;
+ }
+
for (access = ci->access, i = 0; i < ci->accesscount; access++, i++)
if (access->in_use && access->nc == nc)
return access;
@@ -2266,7 +2313,7 @@ int get_access(User * user, ChannelInfo * ci)
{
ChanAccess *access;
- if (!ci)
+ if (!ci || !user)
return 0;
if (is_founder(user, ci))
@@ -2289,7 +2336,7 @@ void update_cs_lastseen(User * user, ChannelInfo * ci)
{
ChanAccess *access;
- if (!ci || !user->na)
+ if (!ci || !user || !user->na)
return;
if (is_founder(user, ci) || nick_identified(user)
@@ -2365,14 +2412,22 @@ static void make_unidentified(User * u, ChannelInfo * ci)
char *cs_get_flood(ChannelInfo * ci)
{
- return ci->mlock_flood;
+ if (!ci) {
+ return NULL;
+ } else {
+ return ci->mlock_flood;
+ }
}
/*************************************************************************/
char *cs_get_key(ChannelInfo * ci)
{
- return ci->mlock_key;
+ if (!ci) {
+ return NULL;
+ } else {
+ return ci->mlock_key;
+ }
}
/*************************************************************************/
@@ -2381,6 +2436,10 @@ char *cs_get_limit(ChannelInfo * ci)
{
static char limit[16];
+ if (!ci) {
+ return NULL;
+ }
+
if (ci->mlock_limit == 0)
return NULL;
@@ -2392,13 +2451,21 @@ char *cs_get_limit(ChannelInfo * ci)
char *cs_get_redirect(ChannelInfo * ci)
{
- return ci->mlock_redirect;
+ if (!ci) {
+ return NULL;
+ } else {
+ return ci->mlock_redirect;
+ }
}
/*************************************************************************/
void cs_set_flood(ChannelInfo * ci, char *value)
{
+ if (!ci) {
+ return;
+ }
+
if (ci->mlock_flood)
free(ci->mlock_flood);
@@ -2415,6 +2482,10 @@ void cs_set_flood(ChannelInfo * ci, char *value)
void cs_set_key(ChannelInfo * ci, char *value)
{
+ if (!ci) {
+ return;
+ }
+
if (ci->mlock_key)
free(ci->mlock_key);
@@ -2431,6 +2502,10 @@ void cs_set_key(ChannelInfo * ci, char *value)
void cs_set_limit(ChannelInfo * ci, char *value)
{
+ if (!ci) {
+ return;
+ }
+
ci->mlock_limit = value ? strtoul(value, NULL, 10) : 0;
if (ci->mlock_limit <= 0)
@@ -2441,6 +2516,10 @@ void cs_set_limit(ChannelInfo * ci, char *value)
void cs_set_redirect(ChannelInfo * ci, char *value)
{
+ if (!ci) {
+ return;
+ }
+
if (ci->mlock_redirect)
free(ci->mlock_redirect);
@@ -2458,6 +2537,10 @@ int get_access_level(ChannelInfo * ci, NickAlias * na)
ChanAccess *access;
int num;
+ if (!ci || !na) {
+ return 0;
+ }
+
if (na->nc == ci->founder) {
return ACCESS_FOUNDER;
}
@@ -4118,6 +4201,10 @@ AutoKick *is_stuck(ChannelInfo * ci, char *mask)
int i;
AutoKick *akick;
+ if (!ci) {
+ return NULL;
+ }
+
for (akick = ci->akick, i = 0; i < ci->akickcount; akick++, i++) {
if (!(akick->flags & AK_USED) || (akick->flags & AK_ISNICK)
|| !(akick->flags & AK_STUCK))
@@ -4142,6 +4229,10 @@ void stick_mask(ChannelInfo * ci, AutoKick * akick)
int i;
char *av[2];
+ if (!ci) {
+ return;
+ }
+
for (i = 0; i < ci->c->bancount; i++) {
/* If akick is already covered by a wider ban.
Example: c->bans[i] = *!*@*.org and akick->u.mask = *!*@*.epona.org */
@@ -4173,6 +4264,10 @@ void stick_all(ChannelInfo * ci)
char *av[2];
AutoKick *akick;
+ if (!ci) {
+ return;
+ }
+
for (akick = ci->akick, i = 0; i < ci->akickcount; akick++, i++) {
if (!(akick->flags & AK_USED) || (akick->flags & AK_ISNICK)
|| !(akick->flags & AK_STUCK))
diff --git a/src/hostserv.c b/src/hostserv.c
index 94e8354f8..84864c33c 100644
--- a/src/hostserv.c
+++ b/src/hostserv.c
@@ -173,6 +173,10 @@ HostCore *findHostCore(HostCore * head, char *nick, boolean * found)
current = head;
previous = current;
+ if (!nick) {
+ return NULL;
+ }
+
while (current != NULL) {
if (stricmp(nick, current->nick) == 0) {
*found = true;
@@ -200,6 +204,10 @@ HostCore *insertHostCore(HostCore * head, HostCore * prev, char *nick,
HostCore *newCore, *tmp;
+ if (!nick || !vHost || !creator) {
+ return NULL;
+ }
+
newCore = malloc(sizeof(HostCore));
if (newCore == NULL) {
anope_cmd_global(s_HostServ,
diff --git a/src/init.c b/src/init.c
index 7843e9d77..83a6866a0 100644
--- a/src/init.c
+++ b/src/init.c
@@ -591,31 +591,38 @@ int init(int ac, char **av)
if (!skeleton) {
load_ns_dbase();
if (debug)
- alog("debug: Loaded %s database (1/8)", s_NickServ);
+ alog("debug: Loaded %s database (1/%d)", s_NickServ,
+ (PreNickDBName ? 8 : 7));
if (s_HostServ) {
load_hs_dbase();
if (debug)
- alog("debug: Loaded %s database (2/8)", s_HostServ);
+ alog("debug: Loaded %s database (2/%d)", s_HostServ,
+ (PreNickDBName ? 8 : 7));
}
if (s_BotServ) {
load_bs_dbase();
if (debug)
- alog("debug: Loaded %s database (3/8)", s_BotServ);
+ alog("debug: Loaded %s database (3/%d)", s_BotServ,
+ (PreNickDBName ? 8 : 7));
} else if (debug)
- alog("debug: BotServ database (3/8) not loaded because BotServ is disabled");
+ alog("debug: BotServ database (3/%d) not loaded because BotServ is disabled", (PreNickDBName ? 8 : 7));
load_cs_dbase();
if (debug)
- alog("debug: Loaded %s database (4/8)", s_ChanServ);
+ alog("debug: Loaded %s database (4/%d)", s_ChanServ,
+ (PreNickDBName ? 8 : 7));
}
load_os_dbase();
if (debug)
- alog("debug: Loaded %s database (5/8)", s_OperServ);
+ alog("debug: Loaded %s database (5/%d)", s_OperServ,
+ (PreNickDBName ? 8 : 7));
load_news();
if (debug)
- alog("debug: Loaded news database (6/8)");
+ alog("debug: Loaded news database (6/%d)",
+ (PreNickDBName ? 8 : 7));
load_exceptions();
if (debug)
- alog("debug: Loaded exception database (7/8)");
+ alog("debug: Loaded exception database (7/%d)",
+ (PreNickDBName ? 8 : 7));
if (PreNickDBName) {
load_ns_req_db();
if (debug)
diff --git a/src/language.c b/src/language.c
index c1a8541a5..ffe3e0b1f 100644
--- a/src/language.c
+++ b/src/language.c
@@ -214,6 +214,10 @@ int strftime_lang(char *buf, int size, User * u, int format, struct tm *tm)
char *s;
int i, ret;
+ if (!tm) {
+ return 0;
+ }
+
strscpy(tmpbuf, langtexts[language][format], sizeof(tmpbuf));
if ((s = langtexts[language][STRFTIME_DAYS_SHORT]) != NULL) {
for (i = 0; i < tm->tm_wday; i++)
@@ -260,7 +264,13 @@ int strftime_lang(char *buf, int size, User * u, int format, struct tm *tm)
void syntax_error(char *service, User * u, char *command, int msgnum)
{
- const char *str = getstring(u->na, msgnum);
+ const char *str;
+
+ if (!u) {
+ return;
+ }
+
+ str = getstring(u->na, msgnum);
notice_lang(service, u, SYNTAX_ERROR, str);
notice_lang(service, u, MORE_INFO, service, command);
}
diff --git a/src/memoserv.c b/src/memoserv.c
index 9e9612d8e..c4e0aacbf 100644
--- a/src/memoserv.c
+++ b/src/memoserv.c
@@ -115,6 +115,13 @@ void check_memos(User * u)
NickCore *nc;
int i, newcnt = 0;
+ if (!u) {
+ if (debug) {
+ alog("debug: check_memos called with NULL values");
+ }
+ return;
+ }
+
if (!(nc = (u->na ? u->na->nc : NULL)) || !nick_recognized(u) ||
!(nc->flags & NI_MEMO_SIGNON))
return;
diff --git a/src/messages.c b/src/messages.c
index c9408a4ac..02f1cd899 100644
--- a/src/messages.c
+++ b/src/messages.c
@@ -72,6 +72,10 @@ int m_time(char *source, int ac, char **av)
struct tm *tm;
char buf[64];
+ if (!source) {
+ return MOD_CONT;
+ }
+
time(&t);
tm = localtime(&t);
strftime(buf, sizeof(buf), "%a %b %d %H:%M:%S %Y %Z", tm);
@@ -86,6 +90,10 @@ int m_motd(char *source)
FILE *f;
char buf[BUFSIZE];
+ if (!source) {
+ return MOD_CONT;
+ }
+
f = fopen(MOTDFilename, "r");
anope_cmd_375(source);
if (f) {
diff --git a/src/misc.c b/src/misc.c
index ec9e4944a..d1db39f18 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -157,6 +157,10 @@ static int do_match_wild(const char *pattern, const char *str, int docase)
char c;
const char *s;
+ if (!str || !*str) {
+ return 0;
+ }
+
/* This WILL eventually terminate: either by *pattern == 0, or by a
* trailing '*'. */
@@ -223,6 +227,10 @@ int process_numlist(const char *numstr, int *count_ret,
int res = 0, retval = 0, count = 0;
va_list args;
+ if (!numstr || !*numstr) {
+ return -1;
+ }
+
va_start(args, u);
/*
@@ -284,6 +292,10 @@ int dotime(const char *s)
{
int amount;
+ if (!s || !*s) {
+ return -1;
+ }
+
amount = strtol(s, (char **) &s, 10);
if (*s) {
switch (*s) {
@@ -630,10 +642,16 @@ char *myStrSubString(const char *src, int start, int end)
void doCleanBuffer(char *str)
{
- char *in = str;
- char *out = str;
+ char *in, *out;
char ch;
+ if (!str) {
+ return;
+ }
+
+ in = str;
+ out = str;
+
while (issp(ch = *in++));
if (ch != '\0')
for (;;) {
@@ -667,6 +685,10 @@ int nickIsServices(char *nick, int bot)
{
int found = 0;
+ if (!nick) {
+ return found;
+ }
+
if (s_NickServ && (stricmp(nick, s_NickServ) == 0))
found++;
else if (s_ChanServ && (stricmp(nick, s_ChanServ) == 0))
diff --git a/src/modules.c b/src/modules.c
index fede2de3c..0adcff9fe 100644
--- a/src/modules.c
+++ b/src/modules.c
@@ -546,6 +546,10 @@ Command *createCommand(const char *name, int (*func) (User * u),
int help_reg, int help_oper, int help_admin,
int help_root)
{
+ if (!name || !*name) {
+ return NULL;
+ }
+
Command *c;
if ((c = malloc(sizeof(Command))) == NULL) {
fatal("Out of memory!");
diff --git a/src/nickserv.c b/src/nickserv.c
index f96268483..befa2c1d4 100644
--- a/src/nickserv.c
+++ b/src/nickserv.c
@@ -1252,7 +1252,7 @@ NickRequest *findrequestnick(const char *nick)
{
NickRequest *nr;
- if (!nick || !*nick) {
+ if (!*nick || !nick) {
if (debug) {
alog("Error: findrequestnick() called with NULL values");
}
@@ -1363,8 +1363,18 @@ int is_on_access(User * u, NickCore * nc)
void alpha_insert_alias(NickAlias * na)
{
NickAlias *ptr, *prev;
- char *nick = na->nick;
- int index = HASH(nick);
+ char *nick;
+ int index;
+
+ if (!na) {
+ if (debug) {
+ alog("debug: alpha_insert_alias called with NULL values");
+ }
+ return;
+ }
+
+ nick = na->nick;
+ index = HASH(nick);
for (prev = NULL, ptr = nalists[index];
ptr && stricmp(ptr->nick, nick) < 0; prev = ptr, ptr = ptr->next);
@@ -1384,7 +1394,16 @@ void alpha_insert_alias(NickAlias * na)
void insert_core(NickCore * nc)
{
- int index = HASH(nc->display);
+ int index;
+
+ if (!nc) {
+ if (debug) {
+ alog("debug: insert_core called with NULL values");
+ }
+ return;
+ }
+
+ index = HASH(nc->display);
nc->prev = NULL;
nc->next = nclists[index];
@@ -1396,6 +1415,13 @@ void insert_core(NickCore * nc)
/*************************************************************************/
void insert_requestnick(NickRequest * nr)
{
+ if (!nr) {
+ if (debug) {
+ alog("debug: insert_requestnick called with NULL values");
+ }
+ return;
+ }
+
int index = HASH(nr->nick);
nr->prev = NULL;
@@ -3667,21 +3693,24 @@ static int do_glist(User * u)
time_t expt;
struct tm *tm;
char buf[BUFSIZE];
+ int wont_expire;
+
notice_lang(s_NickServ, u,
nick ? NICK_GLIST_HEADER_X : NICK_GLIST_HEADER,
na->nc->display);
for (i = 0; i < na->nc->aliases.count; i++) {
na2 = na->nc->aliases.list[i];
if (na2->nc == na->nc) {
- expt = na2->last_seen + NSExpire;
- tm = localtime(&expt);
- strftime_lang(buf, sizeof(buf), na2->u,
- STRFTIME_DATE_TIME_FORMAT, tm);
+ if (!(wont_expire = na2->status & NS_NO_EXPIRE)) {
+ expt = na2->last_seen + NSExpire;
+ tm = localtime(&expt);
+ strftime_lang(buf, sizeof(buf), na2->u,
+ STRFTIME_DATE_TIME_FORMAT, tm);
+ }
notice_lang(s_NickServ, u,
- (is_services_admin(u) ? NICK_GLIST_REPLY_ADMIN
- : NICK_GLIST_REPLY),
- ((na2->status & NS_NO_EXPIRE) ? '!' : ' '),
- na2->nick, buf);
+ ((is_services_admin(u) && !wont_expire)
+ ? NICK_GLIST_REPLY_ADMIN : NICK_GLIST_REPLY),
+ (wont_expire ? '!' : ' '), na2->nick, buf);
}
}
notice_lang(s_NickServ, u, NICK_GLIST_FOOTER,
diff --git a/src/operserv.c b/src/operserv.c
index 7e3864539..49656ee24 100644
--- a/src/operserv.c
+++ b/src/operserv.c
@@ -826,9 +826,10 @@ int is_services_oper(User * u)
int nick_is_services_root(NickCore * nc)
{
- if (nc->flags & (NI_SERVICES_ROOT))
- return 1;
-
+ if (nc) {
+ if (nc->flags & (NI_SERVICES_ROOT))
+ return 1;
+ }
return 0;
}
@@ -838,9 +839,10 @@ int nick_is_services_root(NickCore * nc)
int nick_is_services_admin(NickCore * nc)
{
- if (nc->flags & (NI_SERVICES_ADMIN | NI_SERVICES_ROOT))
- return 1;
-
+ if (nc) {
+ if (nc->flags & (NI_SERVICES_ADMIN | NI_SERVICES_ROOT))
+ return 1;
+ }
return 0;
}
@@ -850,10 +852,12 @@ int nick_is_services_admin(NickCore * nc)
int nick_is_services_oper(NickCore * nc)
{
- if (nc->
- flags & (NI_SERVICES_OPER | NI_SERVICES_ADMIN | NI_SERVICES_ROOT))
- return 1;
-
+ if (nc) {
+ if (nc->
+ flags & (NI_SERVICES_OPER | NI_SERVICES_ADMIN |
+ NI_SERVICES_ROOT))
+ return 1;
+ }
return 0;
}
@@ -1364,7 +1368,13 @@ static int do_ignoreuser(User * u)
void delete_ignore(const char *nick)
{
IgnoreData *ign, *prev;
- IgnoreData **whichlist = &ignore[tolower(nick[0])];
+ IgnoreData **whichlist;
+
+ if (!nick || !*nick) {
+ return;
+ }
+
+ whichlist = &ignore[tolower(nick[0])];
for (ign = *whichlist, prev = NULL; ign; prev = ign, ign = ign->next) {
if (stricmp(ign->who, nick) == 0)
@@ -1887,6 +1897,10 @@ int add_akill(User * u, char *mask, const char *by, const time_t expires,
char *user, *mask2, *host;
Akill *entry;
+ if (!mask) {
+ return -1;
+ }
+
/* Checks whether there is an AKILL that already covers
* the one we want to add, and whether there are AKILLs
* that would be covered by this one. The masks AND the
@@ -2412,6 +2426,10 @@ int add_sgline(User * u, char *mask, const char *by, const time_t expires,
* the useless SGLINEs in the second.
*/
+ if (!mask) {
+ return -1;
+ }
+
if (sglines.count > 0) {
for (i = sglines.count - 1; i >= 0; i--) {
@@ -2861,6 +2879,10 @@ int add_sqline(User * u, char *mask, const char *by, const time_t expires,
* the useless SQLINEs in the second.
*/
+ if (!mask) {
+ return -1;
+ }
+
if (sqlines.count > 0) {
for (i = sqlines.count - 1; i >= 0; i--) {
@@ -3344,6 +3366,10 @@ int add_szline(User * u, char *mask, const char *by, const time_t expires,
int deleted = 0, i;
SXLine *entry;
+ if (!mask) {
+ return -1;
+ }
+
/* Checks whether there is an SZLINE that already covers
* the one we want to add, and whether there are SZLINEs
* that would be covered by this one.
diff --git a/src/rageircd.c b/src/rageircd.c
index 66299805b..ec7a64949 100644
--- a/src/rageircd.c
+++ b/src/rageircd.c
@@ -470,6 +470,7 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
m = createMessage("482", anope_event_482); addCoreMessage(IRCD,m);
+ m = createMessage("461", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m);
m = createMessage("INVITE", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m);
diff --git a/src/unreal32.c b/src/unreal32.c
index 2198d1a5a..b5dfd87d6 100644
--- a/src/unreal32.c
+++ b/src/unreal32.c
@@ -458,6 +458,7 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("401", NULL); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
m = createMessage("451", anope_event_null); addCoreMessage(IRCD,m);
+ m = createMessage("461", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m);
if (UseTokens) {
m = createMessage("6", anope_event_away); addCoreMessage(IRCD,m);
@@ -683,10 +684,6 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("AM", anope_event_null); addCoreMessage(IRCD,m);
}
-
-
-
-
/* The none token version of these is in messages.c */
if (UseTokens) {
m = createMessage("2", m_stats); addCoreMessage(IRCD,m);
diff --git a/src/users.c b/src/users.c
index bd15f8290..2f507311d 100644
--- a/src/users.c
+++ b/src/users.c
@@ -765,7 +765,11 @@ int is_protected(User * user)
int is_oper(User * user)
{
- return (user->mode & UMODE_o);
+ if (user) {
+ return (user->mode & UMODE_o);
+ } else {
+ return 0;
+ }
}
/*************************************************************************/
diff --git a/version.log b/version.log
index 8437b220b..56d589e66 100644
--- a/version.log
+++ b/version.log
@@ -8,10 +8,14 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="5"
-VERSION_BUILD="382"
+VERSION_BUILD="383"
# $Log$
#
+# BUILD : 1.7.5 (383)
+# BUGS : N/A
+# NOTES : glist fix - DrStein, improved on DrStein typo fix to init.c - TSL, tons of NULL crash checks - TSL
+#
# BUILD : 1.7.5 (382)
# BUGS : N/A
# NOTES : Really fix news.c (I hope)