* [PATCH] mailinfo: fix passing wrong address to git_mailinfo_config
@ 2015-11-01 14:30 Nguyễn Thái Ngọc Duy
2015-11-01 18:29 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2015-11-01 14:30 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy
git_mailinfo_config() expects "struct mailinfo *". But in
setup_mailinfo(), "mi" is already "struct mailinfo *". &mi would make
it "struct mailinfo **" and git_mailinfo_config() would damage some
other memory when it assigns some value to mi->use_scissors.
This is caught by t4150.20. git_mailinfo_config() breaks
mi->name.alloc and makes strbuf_release() in clear_mailinfo() attempt
to free strbuf_slopbuf.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
mailinfo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mailinfo.c b/mailinfo.c
index e157ca6..f289941 100644
--- a/mailinfo.c
+++ b/mailinfo.c
@@ -1009,7 +1009,7 @@ void setup_mailinfo(struct mailinfo *mi)
mi->header_stage = 1;
mi->use_inbody_headers = 1;
mi->content_top = mi->content;
- git_config(git_mailinfo_config, &mi);
+ git_config(git_mailinfo_config, mi);
}
void clear_mailinfo(struct mailinfo *mi)
--
2.2.0.513.g477eb31
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-01 18:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-01 14:30 [PATCH] mailinfo: fix passing wrong address to git_mailinfo_config Nguyễn Thái Ngọc Duy
2015-11-01 18:29 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox