From 625de6979e28269bf27b9d35f4e2bb030ad2920a Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Tue, 7 Feb 2023 11:17:48 -0500 Subject: Set msg.cmd to NULL if it is empty string This fixes allowing empty lines from clients during registration. --- bounce.h | 1 + 1 file changed, 1 insertion(+) diff --git a/bounce.h b/bounce.h index 93a3c89..a197053 100644 --- a/bounce.h +++ b/bounce.h @@ -72,6 +72,7 @@ static inline struct Message parse(char *line) { if (line && line[0] == '@') msg.tags = 1 + strsep(&line, " "); if (line && line[0] == ':') msg.origin = 1 + strsep(&line, " "); msg.cmd = strsep(&line, " "); + if (msg.cmd && !msg.cmd[0]) msg.cmd = NULL; for (size_t i = 0; line && i < ParamCap; ++i) { if (line[0] == ':') { msg.params[i] = &line[1]; -- cgit 1.4.1