git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dana How" <danahow@gmail.com>
To: "Junio C Hamano" <junkio@cox.net>
Cc: git@vger.kernel.org, danahow@gmail.com
Subject: Re: [PATCH 02/13] declare overflow during base128 decoding when 1 MSB nonzero, not 7
Date: Thu, 5 Apr 2007 16:08:55 -0700	[thread overview]
Message-ID: <56b7f5510704051608g4bf9ffb7t9f94b532c7a0ebdf@mail.gmail.com> (raw)
In-Reply-To: <7vr6qymo3r.fsf@assigned-by-dhcp.cox.net>

On 4/5/07, Junio C Hamano <junkio@cox.net> wrote:
> "Dana How" <danahow@gmail.com> writes:
> >                               ofs = c & 127;
> >                               while (c & 128) {
> >                                       ofs += 1;
> > -                                     if (!ofs || ofs & ~(~0UL >> 7))
> > +                                     if (!ofs || ofs & ~(~0UL >> 1))
> >                                               die("delta base offset overflow in pack for %s",
> >                                                   sha1_to_hex(entry->sha1));
> >                                       c = buf[used_0++];
> The line after these context does this:
>         ofs = (ofs << 7) + (c & 127);
> If you do not check the top 7 bits, wouldn't you miss overflow?

You are correct in all 4 cases --
this patch can be dropped from the set;
 it has no overlap in any context.

Concerning SEEK_SET,
you are correct: my unistd.h #define's SEEK_SET to 0.
But if someone edits this, the arg order might remain.

I will follow your commit text suggestions.

Let me think about your comment on 08/13.

Thanks!
-- 
Dana L. How  danahow@gmail.com  +1 650 804 5991 cell

  reply	other threads:[~2007-04-05 23:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-05 22:24 [PATCH 02/13] declare overflow during base128 decoding when 1 MSB nonzero, not 7 Dana How
2007-04-05 22:51 ` Junio C Hamano
2007-04-05 23:08   ` Dana How [this message]
2007-04-06  0:29     ` Junio C Hamano
2007-04-06  0:35 ` Nicolas Pitre
2007-04-06  0:45   ` Nicolas Pitre

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=56b7f5510704051608g4bf9ffb7t9f94b532c7a0ebdf@mail.gmail.com \
    --to=danahow@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).