Commit Diff


commit - 430bb223765281487e5c6d415a8efb91e2bf3320
commit + 02cf31c0e267a4c9a7656d43ad3ad4eeb37fc9c5
blob - 317a3e1a1bf99c8379cb20e83419684024c262af
blob + 10f1ef697485886f891dba33eb6a1f9780d90a6c
--- src/ngircd/irc-server.c
+++ src/ngircd/irc-server.c
@@ -186,6 +186,15 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
 		if (!Client_CheckID(Client, Req->argv[0]))
 			return DISCONNECTED;
 
+		if (!Req->prefix) {
+			/* We definitely need a prefix here! */
+			Log(LOG_ALERT, "Got SERVER command without prefix! (on connection %d)",
+			    Client_Conn(Client));
+			Conn_Close(Client_Conn(Client), NULL,
+				   "SERVER command without prefix", true);
+			return DISCONNECTED;
+		}
+
 		from = Client_Search( Req->prefix );
 		if (! from) {
 			/* Uh, Server, that introduced the new server is unknown?! */