From 6f71686e0bac2337cdaf9057893a16a47e7d1033 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 20 Jan 2007 02:25:37 +0100 Subject: 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 --- config.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'config.c') diff --git a/config.c b/config.c index b6082f597c..c08c66890f 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; } -- cgit v1.2.3