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

[PATCH 2/2] Do not accept NUL in the path in .git file

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Aug 21, 2011, 11:58 UTC
Message-ID
<1313927890-21227-2-git-send-email-pclouds@gmail.com>
In-Reply-To
<1313927890-21227-1-git-send-email-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 setup.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/setup.c b/setup.c
index 2c51a9a..c1995b7 100644
--- a/setup.c
+++ b/setup.c
@@ -436,6 +436,8 @@ const char *read_gitfile_gently(const char *path)
 	if (len < 9)
 		die("No path in gitfile: %s", path);
 	buf[len] = '\0';
+	if (strlen(buf) < len)
+		die("invalid gitfile format: %s", path);
 	dir = buf + 8;
 
 	if (!is_absolute_path(dir) && (slash = strrchr(path, '/'))) {
-- 
1.7.4.74.g639db
Previous: Nguyễn Thái Ngọc DuyNext: Junio C Hamano
Message 2 of 9 in “clone: allow to clone from .git file”
  1. 1/2 clone: allow to clone from .git fileNguyễn Thái Ngọc Duy, Aug 21, 2011
  2. 2/2 Do not accept NUL in the path in .git fileNguyễn Thái Ngọc Duy, Aug 21, 2011
  3. Junio C HamanoAug 21, 2011
  4. Nguyen Thai Ngoc DuyAug 22, 2011
  5. Junio C HamanoAug 22, 2011
  6. Re* [PATCH 1/2] clone: allow to clone from .git fileJunio C Hamano, Aug 22, 2011
  7. Nguyen Thai Ngoc DuyAug 23, 2011
  8. Junio C HamanoAug 23, 2011
  9. Nguyen Thai Ngoc DuyAug 23, 2011

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.