Code

commit, merge: initialize static strbuf
authorJeff King <peff@peff.net>
Sun, 18 Dec 2011 05:03:22 +0000 (00:03 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sun, 18 Dec 2011 08:11:54 +0000 (00:11 -0800)
commit2c47789d817aaf745a5ce5d5f79619c634cc8566
treec5a700e745a7d67910a182dbc2cd1d2aeb133c45
parent3b6aeb3cc37c8ef934850fb01e1de48e12cf3aac
commit, merge: initialize static strbuf

Strbufs cannot rely on static all-zero initialization; instead, they must
use STRBUF_INIT to point to the "slopbuf".

Without this patch, "git commit --no-message" segfaults reliably. Fix the
same issue in builtin/merge.c as well.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-commit.c
builtin-merge.c