From: attilamolnar Date: Sun, 17 Jun 2012 12:58:16 +0000 (+0200) Subject: m_shun Fix out of bounds vector access leading to crashes when hiding part reason... X-Git-Tag: v2.0.23~693^2 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=14b7e4c1ab7fd7d9cf71344bb08b211a0aa1ca15;p=user%2Fhenk%2Fcode%2Finspircd.git m_shun Fix out of bounds vector access leading to crashes when hiding part reason for a shunned user --- diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index b3cbbc976..fe1c41162 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_shun.cpp @@ -264,10 +264,10 @@ class ModuleShun : public Module /* Allow QUIT but dont show any quit message */ parameters.clear(); } - else if (command == "PART") + else if ((command == "PART") && (parameters.size() > 1)) { /* same for PART */ - parameters[1] = ""; + parameters[1].clear(); } /* if we're here, allow the command. */