Commit 42c4c624064727188a226bc0ad4f0db7a4b88ac6

Etienne Samson 2018-08-17T18:51:56

config: assert that our parameters are valid CID 1395011

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/config.c b/src/config.c
index 5d95c24..7e1e982 100644
--- a/src/config.c
+++ b/src/config.c
@@ -513,6 +513,8 @@ int git_config_backend_foreach_match(
 	regex_t regex;
 	int error = 0;
 
+	assert(backend && cb);
+
 	if (regexp != NULL) {
 		if ((error = p_regcomp(&regex, regexp, REG_EXTENDED)) != 0) {
 			giterr_set_regex(&regex, error);