git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] fix uninitialized use of msg buffer

From
MCMichael Coleman <tutufan@gmail.com>
Date
Feb 3, 2007, 16:49 UTC
Message-ID
<11705213662728-git-send-email-tutufan@gmail.com>
In-Reply-To
<11705213633209-git-send-email-tutufan@gmail.com>
---
 builtin-branch.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-branch.c b/builtin-branch.c
index d60690b..ac64b99 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -315,7 +315,7 @@ static void create_branch(const char *name, const char *start_name,
 	struct ref_lock *lock;
 	struct commit *commit;
 	unsigned char sha1[20];
-	char ref[PATH_MAX], msg[PATH_MAX + 20];
+	char ref[PATH_MAX], msg[PATH_MAX + 20] = { 0 };
 
 	snprintf(ref, sizeof ref, "refs/heads/%s", name);
 	if (check_ref_format(ref))
-- 
1.5.0.rc3
Previous: Michael ColemanNext: Lars Hjemli
Message 2 of 11 in “fix use of sometimes uninitialized variable 'msg'”
  1. fix use of sometimes uninitialized variable 'msg'Michael Coleman, Feb 3, 2007
  2. fix uninitialized use of msg bufferMichael Coleman, Feb 3, 2007
  3. builtin-branch: be prepared for ref-loggingLars Hjemli, Feb 3, 2007
  4. Junio C HamanoFeb 3, 2007
  5. builtin-branch: be prepared for ref-loggingLars Hjemli, Feb 3, 2007
  6. Junio C HamanoFeb 3, 2007
  7. Lars HjemliFeb 3, 2007
  8. Junio C HamanoFeb 3, 2007
  9. Lars HjemliFeb 3, 2007
  10. Junio C HamanoFeb 3, 2007
  11. Mike ColemanFeb 3, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.