git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nguyen Thai Ngoc Duy" <pclouds@gmail.com>
To: "Junio C Hamano" <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Don't segfault if the given SHA1 name is longer than 40 characters
Date: Thu, 19 Oct 2006 11:54:39 +0700	[thread overview]
Message-ID: <fcaeb9bf0610182154l55de75d1w4a99db608f7f6477@mail.gmail.com> (raw)
In-Reply-To: <7vwt6xvt7q.fsf@assigned-by-dhcp.cox.net>

On 10/19/06, Junio C Hamano <junkio@cox.net> wrote:
> The patch is correct, but it needs a better explanation in the
> proposed commit log message than just "Don't segfault".

Well, maybe because I got a segfault when I accidentally pasted an
sha1 twice (blame my mouse). I hadn't looked closely enough to the
bug. Anyway, you got the bug and obviously have a better explanation
than mine. Please fix it with a better explanation. I'll be more
explanatory next time. Thank you :-)

> get_describe_name() can be fed a string foo-gXXX...XXX with a
> very looooooooong hexstring.  It calls get_short_sha1() without
> checking if XXX...XXX part is longer than 40-bytes (in which
> case it cannot be a valid object name).
>
> get_sha1_1() has the same problem.  Given a hexstring longer
> than 40-bytes, it calls the function with it because earlier
> ones such as get_sha1_hex() would reject the input.
-- 
Duy

      reply	other threads:[~2006-10-19  4:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-19  1:34 [PATCH] Don't segfault if the given SHA1 name is longer than 40 characters pclouds
2006-10-19  4:13 ` Junio C Hamano
2006-10-19  4:54   ` Nguyen Thai Ngoc Duy [this message]

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=fcaeb9bf0610182154l55de75d1w4a99db608f7f6477@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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).