Commit 9f714dec3ae3c5b579483428451c0daf42995a5d

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 569b69f..30d9730 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);