summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2021-08-10 23:29:30 +0200
committerLeah Neukirchen <leah@vuxu.org>2021-08-10 23:29:30 +0200
commit39b303bffbcb52ea36b1d5e30d8531e752233505 (patch)
tree9c76fae671da716c69554c6ead7eae80a3e981ec
parentd5bb43b55dbf2b195923baf1db32ce5cad6e1a64 (diff)
downloadhittpd-39b303bffbcb52ea36b1d5e30d8531e752233505.tar.gz
hittpd-39b303bffbcb52ea36b1d5e30d8531e752233505.tar.xz
hittpd-39b303bffbcb52ea36b1d5e30d8531e752233505.zip
getmime: robustness for empty mime table
Found by Érico Nogueira.
-rw-r--r--hittpd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hittpd.c b/hittpd.c
index d38f9a9..e5114d6 100644
--- a/hittpd.c
+++ b/hittpd.c
@@ -467,7 +467,8 @@ getmime(const char *mime, char *ext)
 	const char *c = mime;
 
 	do {
-		c++;
+		if (*c == ':')
+			c++;
 		if (strncmp(c, ext, extlen) == 0 && c[extlen] == '=')
 			return c + extlen + 1;
 	} while ((c = strchr(c, ':')));