git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH 2/2] Do not accept NUL in the path in .git file
Date: Sun, 21 Aug 2011 18:58:10 +0700	[thread overview]
Message-ID: <1313927890-21227-2-git-send-email-pclouds@gmail.com> (raw)
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

  reply	other threads:[~2011-08-21 11:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-21 11:58 [PATCH 1/2] clone: allow to clone from .git file Nguyễn Thái Ngọc Duy
2011-08-21 11:58 ` Nguyễn Thái Ngọc Duy [this message]
2011-08-21 18:54 ` Junio C Hamano
2011-08-22  3:08   ` Nguyen Thai Ngoc Duy
2011-08-22 19:02     ` Junio C Hamano
2011-08-22 21:01       ` Re* " Junio C Hamano
2011-08-23  1:11         ` Nguyen Thai Ngoc Duy
2011-08-23  3:53           ` Junio C Hamano
2011-08-23  4:11             ` Nguyen Thai Ngoc Duy

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=1313927890-21227-2-git-send-email-pclouds@gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    /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).