From: Jay Soffian <jaysoffian@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] blame: prevent a segv when -L given start > EOF
Date: Mon, 8 Feb 2010 23:09:30 -0500 [thread overview]
Message-ID: <76718491002082009u6a94d628ncf060820d427df7c@mail.gmail.com> (raw)
In-Reply-To: <7vtytrrrju.fsf@alter.siamese.dyndns.org>
On Mon, Feb 8, 2010 at 10:55 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Jay Soffian <jaysoffian@gmail.com> writes:
>
>> - if (lno < top)
>> + if (lno < top || lno < bottom)
>> die("file %s has only %lu lines", path, lno);
>
> Thanks; I think we make sure that "bottom < top" always hold true before
> we reach this point, so checking with bottom alone should suffice, no?
Right, so given "-L 10" at the point of that check:
bottom = 0
top = 10
Whereas given "-L 10,100" at the point of that check:
bottom = 9
top = 100
So the code needs to check both. Previously it made sure neither was
< 1, and swapped bottom/top if they were reversed.
Sorry for the confusion.
j.
next prev parent reply other threads:[~2010-02-09 4:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-09 3:48 [PATCH] blame: prevent a segv when -L given start > EOF Jay Soffian
2010-02-09 3:50 ` Jay Soffian
2010-02-09 3:55 ` Junio C Hamano
2010-02-09 4:00 ` Jay Soffian
2010-02-09 4:02 ` Jay Soffian
2010-02-09 4:09 ` Jay Soffian [this message]
2010-02-09 5:55 ` Junio C Hamano
2010-02-09 7:43 ` Johannes Sixt
2010-02-09 17:55 ` Jay Soffian
2010-02-09 18:06 ` Junio C Hamano
2010-02-09 17:59 ` [PATCH v2] " Jay Soffian
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=76718491002082009u6a94d628ncf060820d427df7c@mail.gmail.com \
--to=jaysoffian@gmail.com \
--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 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).