summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--litterbox.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/litterbox.c b/litterbox.c
index 4a65166..08b98ac 100644
--- a/litterbox.c
+++ b/litterbox.c
@@ -177,12 +177,22 @@ static void handleReplyISupport(struct Message *msg) {
 			set(&chanTypes, msg->params[i]);
 		} else if (!strcmp(key, "PREFIX")) {
 			strsep(&msg->params[i], "(");
-			set(&prefixModes, strsep(&msg->params[i], ")"));
+			char *modes = strsep(&msg->params[i], ")");
+			if (!modes || !msg->params[i]) {
+				errx(EX_PROTOCOL, "invalid PREFIX value");
+			}
+			set(&prefixModes, modes);
 			set(&prefixes, msg->params[i]);
 		} else if (!strcmp(key, "CHANMODES")) {
-			set(&listModes, strsep(&msg->params[i], ","));
-			set(&paramModes, strsep(&msg->params[i], ","));
-			set(&setParamModes, strsep(&msg->params[i], ","));
+			char *list = strsep(&msg->params[i], ",");
+			char *param = strsep(&msg->params[i], ",");
+			char *setParam = strsep(&msg->params[i], ",");
+			if (!list || !param || !setParam) {
+				errx(EX_PROTOCOL, "invalid CHANMODES value");
+			}
+			set(&listModes, list);
+			set(&paramModes, param);
+			set(&setParamModes, setParam);
 		}
 	}
 }
ince the introduction of selective snapshot format configuration in dc3c9b5 (allow selective enabling of snapshots, 2007-07-21), we allowed seven different delimiters for snapshot formats, while the documentation has always been clear about spaces being the only valid delimiter: The value is a space-separated list of zero or more of the values "tar", "tar.gz", "tar.bz2", "tar.xz" and "zip". Supporting the undocumented delimiters makes the code unnecessarily complex. Remove them. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> 2014-01-10Replace most uses of strncmp() with prefixcmp()Lukas Fleischer This is a preparation for replacing all prefix checks with either strip_prefix() or starts_with() when Git 1.8.6 is released. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> 2014-01-09README: Fix dependenciesLukas Fleischer * Remove the dependency on Git (which can be obtained automatically when building, using either the Git submodule or `make get-git`). * Use proper upstream names of dependencies. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> 2014-01-08README: Spelling and formatting fixesLukas Fleischer * Several small spelling and capitalization fixes. * Use consistent and better-looking formatting that is compatible with AsciiDoc (and partly compatible with RST). Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> 2014-01-08Fix UTF-8 with syntax-highlighting.pyPřemysl Janouch Previously the script tried to encode output from Pygments with the ASCII codec, which failed. Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08Add a suggestion to the manpagePřemysl Janouch So that people wishing to use "enable-http-clone" don't have to find out the correct settings on their own. Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08Fix the example configurationPřemysl Janouch "enable-git-clone" doesn't exist, replaced with "enable-http-clone". Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08Fix about-formatting.shPřemysl Janouch dash failed to parse the script. Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08Fix some spelling errorsPřemysl Janouch Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08filters: highlight.sh: add css comments for highlight 2.6 and 3.8Ferry Huberts