summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-01-20 01:25:37 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-01-20 01:55:14 (GMT)
commit6f71686e0bac2337cdaf9057893a16a47e7d1033 (patch)
tree06fd7a1341f2544fe0011bb4c24989bc2209e626 /config.c
parentd23842fd53e61f32c189a6ec902c4133abf29878 (diff)
downloadgit-6f71686e0bac2337cdaf9057893a16a47e7d1033.zip
git-6f71686e0bac2337cdaf9057893a16a47e7d1033.tar.gz
git-6f71686e0bac2337cdaf9057893a16a47e7d1033.tar.bz2
config_set_multivar(): disallow newlines in keys
This will no longer work: $ git repo-config 'key.with newline' some-value Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Diffstat (limited to 'config.c')
-rw-r--r--config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/config.c b/config.c
index b6082f5..c08c668 100644
--- a/config.c
+++ b/config.c
@@ -661,6 +661,11 @@ int git_config_set_multivar(const char* key, const char* value,
goto out_free;
}
c = tolower(c);
+ } else if (c == '\n') {
+ fprintf(stderr, "invalid key (newline): %s\n", key);
+ free(store.key);
+ ret = 1;
+ goto out_free;
}
store.key[i] = c;
}