]> jfr.im git - irc/quakenet/newserv.git/commitdiff
glines: Length check only applies to hostmasks.
authorGunnar Beutner <redacted>
Mon, 15 Jul 2013 19:00:25 +0000 (21:00 +0200)
committerGunnar Beutner <redacted>
Mon, 15 Jul 2013 19:00:25 +0000 (21:00 +0200)
--HG--
branch : shroudtrusts

glines/glines_formats.c

index c65bb1d348c5667b3c1bd271a5874fdf291679a5..252ed2240443facf22910d1de22f02c06c86b9d9 100644 (file)
@@ -61,10 +61,6 @@ gline *makegline(const char *mask) {
   if (strchr(mask, ' ') != NULL)
     return NULL;
 
-  /* Make sure it's not too long */
-  if (strlen(mask) > NICKLEN + USERLEN + HOSTLEN + 2)
-    return NULL;
-
   gl = newgline();
 
   if (!gl) {
@@ -89,6 +85,10 @@ gline *makegline(const char *mask) {
     return gl;
   }
 
+  /* Make sure it's not too long */
+  if (strlen(mask) > NICKLEN + USERLEN + HOSTLEN + 2)
+    return NULL;
+
   strncpy(dupmask, mask, sizeof(dupmask));
   canon_userhost(dupmask, &nick, &user, &host, "*");