Commit 86360ffdf7829d5cd12000067b9e73d3814e2347

nulltoken 2012-01-17T14:33:26

transport: prevent the transport determination mechanism from segfaulting when being passed an url starting with an unknown prefix

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/transport.c b/src/transport.c
index d836561..00b79dc 100644
--- a/src/transport.c
+++ b/src/transport.c
@@ -23,7 +23,7 @@ static struct {
 	{NULL, 0}
 };
 
-#define GIT_TRANSPORT_COUNT (sizeof(transports)/sizeof(transports[0]))
+#define GIT_TRANSPORT_COUNT (sizeof(transports)/sizeof(transports[0])) - 1
 
 static git_transport_cb transport_find_fn(const char *url)
 {