summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes2
-rw-r--r--include/extern.h2
-rw-r--r--src/main.c10
-rw-r--r--src/memory.c4
-rw-r--r--src/modules.c24
-rw-r--r--src/modules/ircd_catserv.c4
-rw-r--r--version.log6
7 files changed, 44 insertions, 8 deletions
diff --git a/Changes b/Changes
index f25b68161..1f5c446d6 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
Anope Version S V N
-------------------
Provided by Anope Dev. <dev@anope.org> - 2004
+12/30 A Warnings for NULL values with sstrdup/moduleData. [ #00]
12/26 A Services can enforce SGLINE and SQLINE by killing the user on set [#245]
12/25 A Flag to tell if we need to enforce SGlines or not [ #00]
12/02 A Support for other Ulines Servers (NeoStats/SolarStats). [ #00]
@@ -15,6 +16,7 @@ Provided by Anope Dev. <dev@anope.org> - 2004
11/19 A Added anope_cmd_ctcp() to code API, for sending CTCP messages. [ #00]
11/18 A Unable to use registered nicknames as bot nicks from now on. [ #00]
11/18 A NSAddAccessOnReg to control access list on registration. [ #00]
+12/30 F Catserv now uses moduleAddCommand instead of addCommand. [ #00]
12/27 F Not freeing memory when a channel got deleted. [ #00]
12/27 F Segfaults with enforcing KillonSGline/KillonSQline. [#260]
12/26 F Updated IRCD doc to show all the flags currently in the code. [ #00]
diff --git a/include/extern.h b/include/extern.h
index 78b3591cc..30cbe07a2 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -613,7 +613,7 @@ E time_t start_time;
E void save_databases(void);
E void expire_all(void);
-E void do_backtrace(void);
+E void do_backtrace(int show_segheader);
E void sighandler(int signum);
/**** memory.c ****/
diff --git a/src/main.c b/src/main.c
index e4bb9ccf6..a44cda93c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -407,7 +407,7 @@ void sighandler(int signum)
}
if (signum == SIGSEGV) {
- do_backtrace();
+ do_backtrace(1);
}
if (started) {
@@ -578,7 +578,7 @@ int main(int ac, char **av, char **envp)
/*************************************************************************/
-void do_backtrace(void)
+void do_backtrace(int show_segheader)
{
#ifdef HAVE_BACKTRACE
void *array[50];
@@ -586,8 +586,10 @@ void do_backtrace(void)
char **strings;
int i;
- alog("Backtrace: Segmentation fault detected");
- alog("Backtrace: report the following lines");
+ if (show_segheader) {
+ alog("Backtrace: Segmentation fault detected");
+ alog("Backtrace: report the following lines");
+ }
alog("Backtrace: Anope version %s %s %s", version_number,
version_build, version_flags);
size = backtrace(array, 10);
diff --git a/src/memory.c b/src/memory.c
index 38e734aab..c1e1ba1c3 100644
--- a/src/memory.c
+++ b/src/memory.c
@@ -120,6 +120,10 @@ char *sstrdup(const char *src)
#else
abort();
#endif
+ } else {
+ alog("sstrdup() called with NULL-arg");
+ if (debug)
+ do_backtrace(0);
}
return ret;
diff --git a/src/modules.c b/src/modules.c
index 20dc37664..83913870f 100644
--- a/src/modules.c
+++ b/src/modules.c
@@ -1823,6 +1823,12 @@ int moduleAddData(ModuleData ** md, char *key, char *value)
alog("A module tried to use ModuleAddData() with one ore more NULL arguments... returning");
return MOD_ERR_PARAMS;
}
+
+ if (mod_current_module_name == NULL) {
+ alog("moduleAddData() called with mod_current_module_name being NULL");
+ if (debug)
+ do_backtrace(0);
+ }
moduleDelData(md, key); /* Remove any existing module data for this module with the same key */
@@ -1862,6 +1868,12 @@ char *moduleGetData(ModuleData ** md, char *key)
char *mod_name = sstrdup(mod_current_module_name);
ModuleData *current = *md;
+ if (mod_current_module_name == NULL) {
+ alog("moduleGetData() called with mod_current_module_name being NULL");
+ if (debug)
+ do_backtrace(0);
+ }
+
if (debug) {
alog("debug: moduleGetData %p : key %s", (void *) md, key);
alog("debug: Current Module %s", mod_name);
@@ -1891,6 +1903,12 @@ void moduleDelData(ModuleData ** md, char *key)
ModuleData *prev = NULL;
ModuleData *next = NULL;
+ if (mod_current_module_name == NULL) {
+ alog("moduleDelData() called with mod_current_module_name being NULL");
+ if (debug)
+ do_backtrace(0);
+ }
+
if (key) {
while (current) {
next = current->next;
@@ -1927,6 +1945,12 @@ void moduleDelAllData(ModuleData ** md)
ModuleData *prev = NULL;
ModuleData *next = NULL;
+ if (mod_current_module_name == NULL) {
+ alog("moduleDelAllData() called with mod_current_module_name being NULL");
+ if (debug)
+ do_backtrace(0);
+ }
+
while (current) {
next = current->next;
if ((stricmp(current->moduleName, mod_name) == 0)) {
diff --git a/src/modules/ircd_catserv.c b/src/modules/ircd_catserv.c
index 17aede270..89118e279 100644
--- a/src/modules/ircd_catserv.c
+++ b/src/modules/ircd_catserv.c
@@ -95,9 +95,9 @@ void addMessageList(void)
{
Command *c;
c = createCommand("meow", do_meow, NULL, -1, -1, -1, -1, -1);
- addCommand(Catserv_cmdTable, c, MOD_UNIQUE);
+ moduleAddCommand(Catserv_cmdTable, c, MOD_UNIQUE);
c = createCommand("purr", do_purr, NULL, -1, -1, -1, -1, -1);
- addCommand(Catserv_cmdTable, c, MOD_UNIQUE);
+ moduleAddCommand(Catserv_cmdTable, c, MOD_UNIQUE);
}
/*****************************************************************************/
diff --git a/version.log b/version.log
index 678dc1b9e..7bb19410a 100644
--- a/version.log
+++ b/version.log
@@ -8,10 +8,14 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="6"
-VERSION_BUILD="512"
+VERSION_BUILD="513"
# $Log$
#
+# BUILD : 1.7.6 (513)
+# BUGS :
+# NOTES : Added warnings for NULL-args with sstrdup, and NULL modname with module*Data functions. Fixed Catserv to use moduleAddCommand instead of addCommand.
+#
# BUILD : 1.7.6 (512)
# BUGS :
# NOTES : Indenting src/modules.c correctly.... it got skipped somehow...