From 92f9e273e86d505e4c2a28bc053eb514ca2cc552 Mon Sep 17 00:00:00 2001 From: Jay Soffian Date: Mon, 8 Feb 2010 22:48:13 -0500 Subject: blame: prevent a segv when -L given start > EOF blame would segv if given -L with past the end of the file. While we're fixing the bug, add test cases for an invalid when called as -L , or -L. Signed-off-by: Jay Soffian Signed-off-by: Junio C Hamano --- builtin-blame.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin-blame.c') diff --git a/builtin-blame.c b/builtin-blame.c index 98e818ce6a..4094f3c061 100644 --- a/builtin-blame.c +++ b/builtin-blame.c @@ -2432,7 +2432,7 @@ parse_done: if (top < 1) top = lno; bottom--; - if (lno < top) + if (lno < top || lno < bottom) die("file %s has only %lu lines", path, lno); ent = xcalloc(1, sizeof(*ent)); -- cgit v1.2.1