Check for missing parameters to iauth messages (SF bug#1685648).
[ircu2.10.12-pk.git] / ircd / s_auth.c
index d3e816b772567052d9e9dcfa9b4b78040c08a2e6..71dad1a81558822633a6594233ac1229651f5123 100644 (file)
@@ -1990,7 +1990,9 @@ static void iauth_parse(struct IAuth *iauth, char *message)
   } else {
     /* Try to find the client associated with the request. */
     id = strtol(params[0], NULL, 10);
-    if (id < 0 || id > HighestFd || !(cli = LocalClientArray[id]))
+    if (parc < 3)
+      sendto_iauth(NULL, "E Missing :Need <id> <ip> <port>");
+    else if (id < 0 || id > HighestFd || !(cli = LocalClientArray[id]))
       /* Client no longer exists (or never existed). */
       sendto_iauth(NULL, "E Gone :[%s %s %s]", params[0], params[1],
                   params[2]);