[eggheads-patches] PATCH:who_stack.patch
Axel Franke
eule at berlin.snafu.de
Mon Oct 30 21:31:08 CST 2000
Hi,
I think this patch fixed bug 126 (found by takeda).
If a ircnetserver not the defaultvalue have:
#define MAXCHANNELSPERUSER 10
but the defaultvalue #define MAXPENALTY 10
the server allowed join more than 10 channels, but dont allow stack
10 or more who in only one line.
But this fixed only this bug, my test shows more bugs with the
stack-issue. For the other bug i look later...
Greeting Eule
-------------- next part --------------
diff -ur eggdrop1.5/src/mod/server.mod/server.c eggneu/src/mod/server.mod/server.c
--- eggdrop1.5/src/mod/server.mod/server.c Tue Oct 31 03:48:05 2000
+++ eggneu/src/mod/server.mod/server.c Tue Oct 31 03:49:31 2000
@@ -393,7 +393,7 @@
struct msgq *m, *nm;
char msgstr[511], nextmsgstr[511], tosend[511], victims[511], stackable[511],
*msg, *nextmsg, *cmd, *nextcmd, *to, *nextto, *stckbl;
- int len, doit = 0, found = 0;
+ int len, doit = 0, found = 0, who_count =0;
Context;
if (!use_fastdeq)
@@ -449,7 +449,10 @@
if (nextto[len - 1] == '\n')
nextto[len - 1] = 0;
if (!strcmp(cmd, nextcmd) && !strcmp(msg, nextmsg)
- && ((strlen(cmd) + strlen(victims) + strlen(nextto) + strlen(msg) + 2) < 510)) {
+ && ((strlen(cmd) + strlen(victims) + strlen(nextto) + strlen(msg) + 2) < 510)
+ && (egg_strcasecmp(cmd, "WHO") || who_count < MAXPENALTY - 1)) {
+ if (!egg_strcasecmp(cmd, "WHO"))
+ who_count++;
simple_sprintf(victims, "%s,%s", victims, nextto);
doit = 1;
m->next = nm->next;
More information about the Patches
mailing list