summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2014-04-30 20:27:59 +0000
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2014-04-30 20:27:59 +0000
commitb3c49556ab0b28c1bcadb031c398a9c160720f07 (patch)
tree99e8f1763d0254b6e3ae16f78a71b050ab293e36
parenta3cc519f08f5185313edf7da7dd18b33c75c3e41 (diff)
- Fixed possible WATCH core. Fix provided by Adam
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@3426 82007160-df01-0410-b94d-b575c5fd34c7
-rw-r--r--modules/m_watch.c3
-rw-r--r--src/watch.c6
2 files changed, 5 insertions, 4 deletions
diff --git a/modules/m_watch.c b/modules/m_watch.c
index 1c84613..7841f78 100644
--- a/modules/m_watch.c
+++ b/modules/m_watch.c
@@ -103,7 +103,8 @@ m_watch(struct Client *client_p, struct Client *source_p, int parc, char *parv[]
continue;
}
- watch_add_to_hash_table(s + 1, source_p);
+ if (valid_nickname(s + 1, 1))
+ watch_add_to_hash_table(s + 1, source_p);
}
show_watch(source_p, s + 1, RPL_NOWON, RPL_NOWOFF);
diff --git a/src/watch.c b/src/watch.c
index cdc859d..b3aff72 100644
--- a/src/watch.c
+++ b/src/watch.c
@@ -142,7 +142,7 @@ watch_add_to_hash_table(const char *nick, struct Client *client_p)
anptr->lasttime = CurrentTime;
strlcpy(anptr->nick, nick, sizeof(anptr->nick));
- dlinkAdd(anptr, &anptr->node, &watchTable[strhash(nick)]);
+ dlinkAdd(anptr, &anptr->node, &watchTable[strhash(anptr->nick)]);
}
else
{
@@ -183,8 +183,8 @@ watch_del_from_hash_table(const char *nick, struct Client *client_p)
/* In case this header is now empty of notices, remove it */
if (anptr->watched_by.head == NULL)
{
- assert(dlinkFind(&watchTable[strhash(nick)], anptr) != NULL);
- dlinkDelete(&anptr->node, &watchTable[strhash(nick)]);
+ assert(dlinkFind(&watchTable[strhash(anptr->nick)], anptr) != NULL);
+ dlinkDelete(&anptr->node, &watchTable[strhash(anptr->nick)]);
mp_pool_release(anptr);
}
}