Handle join requests for too-long channel names.
[ircu2.10.12-pk.git] / ircd / m_join.c
index 091562bfca904fa04acde883fbef782122bd2ee3..66b1a5835e58fa0550d6ed4f601aabe728ad5352 100644 (file)
@@ -41,6 +41,7 @@
 #include "s_debug.h"
 #include "s_user.h"
 #include "send.h"
+#include "sys.h"
 
 /* #include <assert.h> -- Now using assert in ircd_log.h */
 #include <stdlib.h>
@@ -156,7 +157,8 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
     }
 
     if (!(chptr = FindChannel(name))) {
-      if ((name[0] == '&') && !feature_bool(FEAT_LOCAL_CHANNELS)) {
+      if (((name[0] == '&') && !feature_bool(FEAT_LOCAL_CHANNELS))
+          || strlen(name) >= IRCD_MIN(CHANNELLEN, feature_int(FEAT_CHANNELLEN))) {
         send_reply(sptr, ERR_NOSUCHCHANNEL, name);
         continue;
       }