From 5799b2f9e5cfc931812f0924cae308542f6bd316 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 26 Jan 2008 21:39:13 +0000 Subject: [PATCH] Backport: Fix for bug found by eLement, when an oper is on a notify list and the oper sets +Q, then the watch list for that user goes into an undefined state due to the metadata not being correctly cleared from the user in m_watch OnUserQuit. Thanks :) git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@8753 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_watch.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index feb7e2c43..fea89fd79 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -98,6 +98,10 @@ class cmd_watch : public command_t { /* Yup, is on my list */ watchlist::iterator n = wl->find(nick); + + if (!wl) + return CMD_FAILURE; + if (n != wl->end()) { if (!n->second.empty()) @@ -370,6 +374,7 @@ class Modulewatch : public Module /* User's quitting, we're done with this. */ delete wl; + user->Shrink("watchlist"); } }