cgit

commit 82a883ede7e47616aba041a5eb36e08666ef9177

Author: Lars Hjemli <hjemli@gmail.com>

Use GIT-1.7.3

This fixes http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-2542.

Noticed-by: Silvio Cesare <silvio.cesare@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>

 Makefile | 4 ++--
 cgit.c | 2 +-
 ui-plain.c | 2 +-
 ui-stats.c | 8 ++++----


diff --git a/Makefile b/Makefile
index 51620208512ec618de7ba3e17890f3844c70cae4..0349639c47b357f20bfa86457f9777917f4b09ac 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH)
 CGIT_CONFIG = /etc/cgitrc
 CACHE_ROOT = /var/cache/cgit
 SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 1.6.4.3
+GIT_VER = 1.7.3
 GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2
 INSTALL = install
 
@@ -68,7 +68,7 @@ %.o: %.c
 	$(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $<
 
 
-EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto
+EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto -lpthread
 OBJECTS =
 OBJECTS += cache.o
 OBJECTS += cgit.o




diff --git a/cgit.c b/cgit.c
index 6c7e8111c4cf31456983fe9f946cd5eb8410c3c8..ad62d10887e8ecdda4bb43fb86e349c51f8c8afb 100644
--- a/cgit.c
+++ b/cgit.c
@@ -21,7 +21,7 @@ void add_mimetype(const char *name, const char *value)
 {
 	struct string_list_item *item;
 
-	item = string_list_insert(xstrdup(name), &ctx.cfg.mimetypes);
+	item = string_list_insert(&ctx.cfg.mimetypes, xstrdup(name));
 	item->util = xstrdup(value);
 }
 








diff --git a/ui-plain.c b/ui-plain.c
index 66cb19cdbd1058e37e60157c40a18d1a782bb3ff..5569a7cb3b107188385f45a96cde0e044e424f14 100644
--- a/ui-plain.c
+++ b/ui-plain.c
@@ -35,7 +35,7 @@ 	}
 	ctx.page.mimetype = NULL;
 	ext = strrchr(path, '.');
 	if (ext && *(++ext)) {
-		mime = string_list_lookup(ext, &ctx.cfg.mimetypes);
+		mime = string_list_lookup(&ctx.cfg.mimetypes, ext);
 		if (mime)
 			ctx.page.mimetype = (char *)mime->util;
 	}




diff --git a/ui-stats.c b/ui-stats.c
index bdaf9cc8e3a2533736e6dbfd8bf51d0cf6f91c2e..50c2540c860b6275b06b84576ecfd81c032e208d 100644
--- a/ui-stats.c
+++ b/ui-stats.c
@@ -175,7 +175,7 @@ 	time_t t;
 
 	info = cgit_parse_commit(commit);
 	tmp = xstrdup(info->author);
-	author = string_list_insert(tmp, authors);
+	author = string_list_insert(authors, tmp);
 	if (!author->util)
 		author->util = xcalloc(1, sizeof(struct authorstat));
 	else
@@ -186,7 +186,7 @@ 	t = info->committer_date;
 	date = gmtime(&t);
 	period->trunc(date);
 	tmp = xstrdup(period->pretty(date));
-	item = string_list_insert(tmp, items);
+	item = string_list_insert(items, tmp);
 	if (item->util)
 		free(tmp);
 	item->util++;
@@ -279,7 +279,7 @@ 		for (i = from; i <= to; i++) {
 			author = &authors->items[i];
 			authorstat = author->util;
 			items = &authorstat->list;
-			date = string_list_lookup(tmp, items);
+			date = string_list_lookup(items, tmp);
 			if (date)
 				subtotal += (size_t)date->util;
 		}
@@ -331,7 +331,7 @@ 			period->dec(tm);
 		for (j = 0; j < period->count; j++) {
 			tmp = period->pretty(tm);
 			period->inc(tm);
-			date = string_list_lookup(tmp, items);
+			date = string_list_lookup(items, tmp);
 			if (!date)
 				html("<td>0</td>");
 			else {