Re: [PATCH] blame: prevent a segv when -L given start > EOF
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 9, 2010, 05:55 UTC
- Message-ID
- <7vwrynq7fc.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <7vtytrrrju.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> 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?I am ... stupid. If lno < bottom, then lno < top, but we need to check both anyway.