From: René Scharfe Date: Sun, 8 Mar 2026 09:57:02 +0000 (+0100) Subject: history: initialize rev_info in cmd_history_reword() X-Git-Tag: v2.54.0-rc0~67^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d1f33c753d;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- diff --git a/builtin/history.c b/builtin/history.c index 1cf6c668cf..88822a184f 100644 --- a/builtin/history.c +++ b/builtin/history.c @@ -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);