From 785a04298177e155dc7391e7234945b38b624e34 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 23 Jan 2013 01:23:27 -0500 Subject: archive-tar: use parse_config_key when parsing config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is fewer lines of code, but more importantly, fixes a bogus pointer offset. We are looking for "tar." in the section, but later assume that the dot we found is at offset 9, not 3. This is a holdover from an earlier iteration of 767cf45 which called the section "tarfilter". As a result, we could erroneously reject some filters with dots in their name, as well as read uninitialized memory. Reported by (and test by) René Scharfe. Signed-off-by: Jeff King Reviewed-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- t/t5000-tar-tree.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 't/t5000-tar-tree.sh') diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh index e7c240fc1f..3fbd366ec3 100755 --- a/t/t5000-tar-tree.sh +++ b/t/t5000-tar-tree.sh @@ -212,7 +212,8 @@ test_expect_success 'git-archive --prefix=olde-' ' test_expect_success 'setup tar filters' ' git config tar.tar.foo.command "tr ab ba" && git config tar.bar.command "tr ab ba" && - git config tar.bar.remote true + git config tar.bar.remote true && + git config tar.invalid baz ' test_expect_success 'archive --list mentions user filter' ' -- cgit v1.2.1