diff options
Diffstat (limited to 'builtin-apply.c')
-rw-r--r-- | builtin-apply.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin-apply.c b/builtin-apply.c index 2b8ba81d81..5ed4e918c0 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -1809,6 +1809,9 @@ static int find_pos(struct image *img, else if (match_end) line = img->nr - preimage->nr; + if (line > img->nr) + line = img->nr; + try = 0; for (i = 0; i < line; i++) try += img->line[i].len; |