blame: prevent a segv when -L given start > EOF
[gitweb.git] / builtin-blame.c
index 98e818ce6a63b352182b428b49464596d37a0617..4094f3c06111e365c6ab6063746e5928bd2ee8a1 100644 (file)
@@ -2432,7 +2432,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
        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));