summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2015-11-01 15:30:30 +0100
committerJunio C Hamano <gitster@pobox.com>2015-11-01 10:29:40 -0800
commit85d9d9ddf38aba0c13a1be8f667af6b8cf021ca6 (patch)
tree3a282a2a07d3a49039868e99da8613868fbf7290
parent6ac617a321383b2e3a0f0537e3224ec6229e6500 (diff)
downloadgit-85d9d9ddf38aba0c13a1be8f667af6b8cf021ca6.tar.gz
mailinfo: fix passing wrong address to git_mailinfo_configjc/mailinfo-lib
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--mailinfo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mailinfo.c b/mailinfo.c
index e157ca6eb5..f289941f7e 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)