Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/config.c b/config.c
index a23f260792..fd92738fba 100644
--- a/config.c
+++ b/config.c
@@ -2547,10 +2547,14 @@ int parse_config_key(const char *var,
/* Did we have a subsection at all? */
if (dot == var) {
- *subsection = NULL;
- *subsection_len = 0;
+ if (subsection) {
+ *subsection = NULL;
+ *subsection_len = 0;
+ }
}
else {
+ if (!subsection)
+ return -1;
*subsection = var + 1;
*subsection_len = dot - *subsection;
}