All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ariel Badichi <abadichi@bezeqint.net>
To: git@vger.kernel.org
Cc: gitster@pobox.com
Subject: [PATCH] archive.c: format_subst - fixed bogus argument to memchr
Date: Wed, 23 Apr 2008 03:24:21 +0300	[thread overview]
Message-ID: <87od81peog.fsf@sneeze.site> (raw)


Also removed a superfluous test.

Signed-off-by: Ariel Badichi <abadichi@bezeqint.net>
---
 archive.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/archive.c b/archive.c
index fb159fe..7a32c19 100644
--- a/archive.c
+++ b/archive.c
@@ -16,9 +16,9 @@ static void format_subst(const struct commit *commit,
 		const char *b, *c;
 
 		b = memmem(src, len, "$Format:", 8);
-		if (!b || src + len < b + 9)
+		if (!b)
 			break;
-		c = memchr(b + 8, '$', len - 8);
+		c = memchr(b + 8, '$', (src + len) - b - 8);
 		if (!c)
 			break;
 
-- 
1.5.5.1.57.g5909c

             reply	other threads:[~2008-04-23  1:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-23  0:24 Ariel Badichi [this message]
2008-04-23  1:28 ` [PATCH] archive.c: format_subst - fixed bogus argument to memchr Ariel Badichi
2008-04-23 15:54 ` René Scharfe
  -- strict thread matches above, loose matches on Subject: below --
2008-04-23  1:06 Ariel Badichi

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=87od81peog.fsf@sneeze.site \
    --to=abadichi@bezeqint.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.