summaryrefslogtreecommitdiff
path: root/mailinfo.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2015-11-01 14:30:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-11-01 18:29:40 (GMT)
commit85d9d9ddf38aba0c13a1be8f667af6b8cf021ca6 (patch)
tree3a282a2a07d3a49039868e99da8613868fbf7290 /mailinfo.c
parent6ac617a321383b2e3a0f0537e3224ec6229e6500 (diff)
downloadgit-85d9d9ddf38aba0c13a1be8f667af6b8cf021ca6.zip
git-85d9d9ddf38aba0c13a1be8f667af6b8cf021ca6.tar.gz
git-85d9d9ddf38aba0c13a1be8f667af6b8cf021ca6.tar.bz2
mailinfo: fix passing wrong address to git_mailinfo_config
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>
Diffstat (limited to 'mailinfo.c')
-rw-r--r--mailinfo.c2
1 files changed, 1 insertions, 1 deletions
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)