Commit 8452fecc8fc14a59d37c7f06c9355e560aa66ed0

Edward Thomson 2015-09-14T14:05:01

cl_git_path_url: assert sane static buffer size

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/tests/clar_libgit2.c b/tests/clar_libgit2.c
index cc687ba..61442f8 100644
--- a/tests/clar_libgit2.c
+++ b/tests/clar_libgit2.c
@@ -299,6 +299,8 @@ const char* cl_git_path_url(const char *path)
 		in_buf++;
 	}
 
+	cl_assert(url_buf.size < 4096);
+
 	strncpy(url, git_buf_cstr(&url_buf), 4096);
 	git_buf_free(&url_buf);
 	git_buf_free(&path_buf);