about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2023-02-07 11:17:48 -0500
committerJune McEnroe <june@causal.agency>2023-02-07 11:17:48 -0500
commit625de6979e28269bf27b9d35f4e2bb030ad2920a (patch)
treefcf7dae5e1868ece448d0bbb00c156afb7272a7b
parentFix segfault parsing line with only tags (diff)
downloadpounce-625de6979e28269bf27b9d35f4e2bb030ad2920a.tar.gz
pounce-625de6979e28269bf27b9d35f4e2bb030ad2920a.zip
Set msg.cmd to NULL if it is empty string
This fixes allowing empty lines from clients during registration.
-rw-r--r--bounce.h1
1 files changed, 1 insertions, 0 deletions
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];
fa8e251500dd9c1d059f518147fb102b7e80160&follow=1'>Update Vim-Tomorrow-ThemeJune McEnroe 2012-01-30Disable menu bar in GVimJune McEnroe 2012-01-30Set shiftwidth to 4 for LuaJune McEnroe 2012-01-29Don't show Syntastic errors automaticallyJune McEnroe 2012-01-28Update to Quicktask 1.1June McEnroe 2012-01-22Use space-test branch of quicktaskJune McEnroe 2012-01-22Enable syntax-based foldingJune McEnroe 2012-01-22Update quicktaskJune McEnroe 2012-01-22Revert "Add AutoClose"June McEnroe 2012-01-22Revert "Disable powerline for now"June McEnroe 2012-01-22Revert "Add VCS repo directories to wildignore"June McEnroe 2012-01-22Disable powerline for nowJune McEnroe 2012-01-22Update some pluginsJune McEnroe 2012-01-22Add VCS repo directories to wildignoreJune McEnroe 2012-01-22Map ,e and ,b to CtrlP file and buffer respectivelyJune McEnroe 2012-01-22Add vim-spaceJune McEnroe 2012-01-22Add AutoCloseJune McEnroe 2012-01-22Add binding for GundoJune McEnroe 2012-01-22Add GundoJune McEnroe 2012-01-22Add Jellybeans colorschemeJune McEnroe 2012-01-22Add syntasticJune McEnroe 2012-01-21Add PowerlineJune McEnroe 2012-01-21Add quicktaskJune McEnroe 2012-01-15Moved comments out of mapsJune McEnroe 2012-01-14Disable scrollbarsJune McEnroe