git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: git@vger.kernel.org, gitster@pobox.com, jasampler@gmail.com
Subject: [PATCH 2/2] builtin-tag: fix uninitialized variables
Date: Fri, 20 Jul 2007 13:07:27 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0707201306340.14781@racer.site> (raw)


The function launch_editor() expects the variables 'buffer' and 'size'
to be initialized, either to an existing buffer, or to NULL and 0.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
	This is only called 2/2, because I found this error by testing 
	1/2...

 builtin-tag.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin-tag.c b/builtin-tag.c
index cf36def..81d37ce 100644
--- a/builtin-tag.c
+++ b/builtin-tag.c
@@ -253,9 +253,9 @@ static void create_tag(const unsigned char *object, const char *tag,
 		       char *message, int sign, unsigned char *result)
 {
 	enum object_type type;
-	char header_buf[1024], *buffer;
+	char header_buf[1024], *buffer = NULL;
 	int header_len, max_size;
-	unsigned long size;
+	unsigned long size = 0;
 
 	type = sha1_object_info(object, NULL);
 	if (type <= 0)
-- 
1.5.3.rc1.16.g9d6f-dirty

                 reply	other threads:[~2007-07-20 12:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0707201306340.14781@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jasampler@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).