Commit 9f714dec by Etienne Samson

config: assert that our parameters are valid

CID 1395011
parent fba70a9d
...@@ -513,6 +513,8 @@ int git_config_backend_foreach_match( ...@@ -513,6 +513,8 @@ int git_config_backend_foreach_match(
regex_t regex; regex_t regex;
int error = 0; int error = 0;
assert(backend && cb);
if (regexp != NULL) { if (regexp != NULL) {
if ((error = p_regcomp(&regex, regexp, REG_EXTENDED)) != 0) { if ((error = p_regcomp(&regex, regexp, REG_EXTENDED)) != 0) {
giterr_set_regex(&regex, error); giterr_set_regex(&regex, error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment