1
0
mirror of https://github.com/git/git.git synced 2024-09-30 04:22:06 +02:00

Fix buggy ref recording

There is a format string vulnerability introduced with the packed refs
file format.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Petr Baudis 2006-09-23 01:08:45 +02:00 committed by Junio C Hamano
parent afdcec7366
commit 7c1a278d99

2
refs.c

@ -472,7 +472,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *ref,
lock->ref_name = xstrdup(ref);
lock->log_file = xstrdup(git_path("logs/%s", ref));
ref_file = git_path(ref);
ref_file = git_path("%s", ref);
lock->force_write = lstat(ref_file, &st) && errno == ENOENT;
if (safe_create_leading_directories(ref_file))