summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3b6aeb3)
raw | patch | inline | side by side (parent: 3b6aeb3)
author | Jeff King <peff@peff.net> | |
Sun, 18 Dec 2011 05:03:22 +0000 (00:03 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 18 Dec 2011 08:11:54 +0000 (00:11 -0800) |
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>
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 | patch | blob | history | |
builtin-merge.c | patch | blob | history |
diff --git a/builtin-commit.c b/builtin-commit.c
index 7434797d1b850b25d13aab8d7aeaf85d02109a61..5b418a53f8af4bc5241f7ffcbad8592bd3e8e3af 100644 (file)
--- a/builtin-commit.c
+++ b/builtin-commit.c
static int use_editor = 1, initial_commit, in_merge;
static const char *only_include_assumed;
-static struct strbuf message;
+static struct strbuf message = STRBUF_INIT;
static int opt_parse_m(const struct option *opt, const char *arg, int unset)
{
diff --git a/builtin-merge.c b/builtin-merge.c
index 8825dcf8d9c4cce3fa0321a808877237d05d4f5a..49e9115ec449eb4b8b38d9391496b5640c403118 100644 (file)
--- a/builtin-merge.c
+++ b/builtin-merge.c
static int show_diffstat = 1, option_log, squash;
static int option_commit = 1, allow_fast_forward = 1;
static int allow_trivial = 1, have_message;
-static struct strbuf merge_msg;
+static struct strbuf merge_msg = STRBUF_INIT;
static struct commit_list *remoteheads;
static unsigned char head[20], stash[20];
static struct strategy **use_strategies;