Skip to content

Commit 85d9d9d

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6ac617a commit 85d9d9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mailinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ void setup_mailinfo(struct mailinfo *mi)
10091009
mi->header_stage = 1;
10101010
mi->use_inbody_headers = 1;
10111011
mi->content_top = mi->content;
1012-
git_config(git_mailinfo_config, &mi);
1012+
git_config(git_mailinfo_config, mi);
10131013
}
10141014

10151015
void clear_mailinfo(struct mailinfo *mi)

0 commit comments

Comments
 (0)