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>
Petr Baudis committed
Sep 23, 2006 at 01:08 UTC
7c1a278d99a18445e12bd55e308cd69080963198
1 file changed
+1
-1
refs.c
+1
-1
@@ -472,7 +472,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *ref,
472
473
lock->ref_name = xstrdup(ref);
474
lock->log_file = xstrdup(git_path("logs/%s", ref));
475
- ref_file = git_path(ref);
475
+ ref_file = git_path("%s", ref);
476
lock->force_write = lstat(ref_file, &st) && errno == ENOENT;
477
478
if (safe_create_leading_directories(ref_file))