mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-03 05:12:56 -05:00
history: initialize rev_info in cmd_history_reword()
git history reword expects a single valid revision argument and errors out if it doesn't get it. In that case the struct rev_info passed to release_revisions() for cleanup is still uninitialized, which can result in attempts to free(3) random pointers. Avoid that by initializing the structure. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
1278a26544
commit
d1f33c753d
@@ -425,7 +425,7 @@ static int cmd_history_reword(int argc,
|
||||
};
|
||||
struct strbuf reflog_msg = STRBUF_INIT;
|
||||
struct commit *original, *rewritten;
|
||||
struct rev_info revs;
|
||||
struct rev_info revs = { 0 };
|
||||
int ret;
|
||||
|
||||
argc = parse_options(argc, argv, prefix, options, usage, 0);
|
||||
|
||||
Reference in New Issue
Block a user