summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkeeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b <keeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-08-10 17:22:47 +0000
committerkeeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b <keeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-08-10 17:22:47 +0000
commit8da5da23a9529e18ea15779700b6c97fce10ee66 (patch)
treeb7eb91b3f5a70c816142071241cc06e2f355503e
parentebe870906bb0820e9efb96c20832d40c6343f4af (diff)
BUILD : 1.7.5 (316) BUGS : 131 NOTES : Fixed bugs in previous BotServ buffer fix.
git-svn-id: svn://svn.anope.org/anope/trunk@316 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@194 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--Changes1
-rw-r--r--src/botserv.c17
-rw-r--r--src/messages.c9
-rw-r--r--version.log6
4 files changed, 15 insertions, 18 deletions
diff --git a/Changes b/Changes
index 38ccd06ce..426ec9999 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
Anope Version 1.7.5
-------------------
Provided by Anope Dev. <dev@anope.org> - 2004
+08/10 F Fixed previous BotServ buffer fix. [#131]
07/17 A Switched to autoconf for configure script. [ #00]
07/05 A Warning when LocalAddress conflicts with RemoteServer. [#118]
06/18 A Added proper Bahamut1.8 support. [ #55]
diff --git a/src/botserv.c b/src/botserv.c
index 6f1ff2289..b8710672b 100644
--- a/src/botserv.c
+++ b/src/botserv.c
@@ -185,17 +185,15 @@ void botmsgs(User * u, BotInfo * bi, char *buf)
*
*/
-void botchanmsgs(User * u, ChannelInfo * ci, char *buff)
+void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
{
int c;
int16 cstatus = 0;
- char *cmd, *buf;
+ char *cmd;
UserData *ud;
- buf = sstrdup(buff);
if (!u) {
- free(buf);
return;
}
@@ -243,7 +241,6 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buff)
if ((ci->botflags & BS_KICK_BOLDS) && strchr(buf, 2)) {
check_ban(ci, u, TTB_BOLDS);
bot_kick(ci, u, BOT_REASON_BOLD);
- free(buf);
return;
}
@@ -251,7 +248,6 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buff)
if ((ci->botflags & BS_KICK_COLORS) && strchr(buf, 3)) {
check_ban(ci, u, TTB_COLORS);
bot_kick(ci, u, BOT_REASON_COLOR);
- free(buf);
return;
}
@@ -259,7 +255,6 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buff)
if ((ci->botflags & BS_KICK_REVERSES) && strchr(buf, 22)) {
check_ban(ci, u, TTB_REVERSES);
bot_kick(ci, u, BOT_REASON_REVERSE);
- free(buf);
return;
}
@@ -267,7 +262,6 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buff)
if ((ci->botflags & BS_KICK_UNDERLINES) && strchr(buf, 31)) {
check_ban(ci, u, TTB_UNDERLINES);
bot_kick(ci, u, BOT_REASON_UNDERLINE);
- free(buf);
return;
}
@@ -285,7 +279,6 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buff)
if (i >= ci->capsmin && i * 100 / c >= ci->capspercent) {
check_ban(ci, u, TTB_CAPS);
bot_kick(ci, u, BOT_REASON_CAPS);
- free(buf);
return;
}
}
@@ -405,7 +398,6 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buff)
bot_kick(ci, u, BOT_REASON_BADWORD_GENTLE);
else
bot_kick(ci, u, BOT_REASON_BADWORD, bw->word);
- free(buf);
return;
}
}
@@ -421,7 +413,6 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buff)
ud = get_user_data(ci->c, u);
if (!ud) {
- free(buf);
return;
}
@@ -434,7 +425,6 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buff)
if (ud->lines >= ci->floodlines) {
check_ban(ci, u, TTB_FLOOD);
bot_kick(ci, u, BOT_REASON_FLOOD);
- free(buf);
return;
}
}
@@ -443,7 +433,6 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buff)
if (ci->botflags & BS_KICK_REPEAT) {
ud = get_user_data(ci->c, u);
if (!ud) {
- free(buf);
return;
}
if (ud->lastline && stricmp(ud->lastline, buf)) {
@@ -459,7 +448,6 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buff)
if (ud->times >= ci->repeattimes) {
check_ban(ci, u, TTB_REPEAT);
bot_kick(ci, u, BOT_REASON_REPEAT);
- free(buf);
return;
}
}
@@ -468,7 +456,6 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buff)
/* return if the user is on the ignore list */
if (get_ignore(u->nick) != NULL) {
- free(buf);
return;
}
diff --git a/src/messages.c b/src/messages.c
index 9e5d4466b..eb83909b2 100644
--- a/src/messages.c
+++ b/src/messages.c
@@ -577,6 +577,7 @@ static int m_part(char *source, int ac, char **av)
static int m_privmsg(char *source, int ac, char **av)
{
char *s;
+ char *buf;
time_t starttime, stoptime; /* When processing started and finished */
BotInfo *bi;
@@ -596,8 +597,12 @@ static int m_privmsg(char *source, int ac, char **av)
if (*av[0] == '#') {
if (s_BotServ && (ci = cs_findchan(av[0])))
- if (!(ci->flags & CI_VERBOTEN) && ci->c && ci->bi) /* Some paranoia checks */
- botchanmsgs(u, ci, av[1]);
+ if (!(ci->flags & CI_VERBOTEN) && ci->c && ci->bi)
+ /* Some paranoia checks */
+ /* Copy the message to a temp. variable, otherwise botchanmsgs would break the buffer for modules -Keeper */
+ buf = sstrdup(av[1]);
+ botchanmsgs(u, ci, buf);
+ free(buf);
} else {
/* Check if we should ignore. Operators always get through. */
diff --git a/version.log b/version.log
index 173c59b67..afc0cc0bc 100644
--- a/version.log
+++ b/version.log
@@ -8,10 +8,14 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="5"
-VERSION_BUILD="315"
+VERSION_BUILD="316"
# $Log$
#
+# BUILD : 1.7.5 (316)
+# BUGS : 131
+# NOTES : Fixed bugs in previous BotServ buffer fix.
+#
# BUILD : 1.7.5 (315)
# BUGS :
# NOTES : Updated documentation to suit the new build process