+
+ /* CR and LF are never allowed in command parameters.
+ * But since we do accept lines terminated only with CR or LF in
+ * "non-RFC-compliant mode" (besides the correct CR+LF combination),
+ * this check can only trigger in "strict RFC" mode; therefore we
+ * optimize it away otherwise ... */
+ for (i = 0; i < Req->argc; i++) {
+ if (strchr(Req->argv[i], '\r') || strchr(Req->argv[i], '\n')) {
+ Log(LOG_ERR,
+ "Invalid character(s) in parameter (connection %d, command %s)!?",
+ Idx, Req->command);
+ if (!Conn_WriteStr(Idx,
+ "ERROR :Invalid character(s) in parameter!"))
+ *Closed = true;
+ return false;
+ }
+ }
+#endif