Line 0
Link Here
|
|
|
1 |
# Origin: https://github.com/jonas/tig/commit/718c6e94fcc111e5607d6ca0bf3d15271adc0d97 |
2 |
# Subject: ui: fix crash due to out-of-bounds array access |
3 |
|
4 |
--- src/ui.c.orig 2015-04-09 00:19:11 UTC |
5 |
+++ src/ui.c |
6 |
@@ -293,7 +293,7 @@ open_file_finder(const char *commit) |
7 |
finder.keymap = get_keymap("search", STRING_SIZE("search")), |
8 |
file_finder_update(&finder); |
9 |
file_finder_draw(&finder); |
10 |
- if (read_prompt_incremental("Find file: ", FALSE, file_finder_input_handler, &finder)) |
11 |
+ if (read_prompt_incremental("Find file: ", FALSE, file_finder_input_handler, &finder) && finder.pos.lineno < finder.lines) |
12 |
file = get_path(finder.line[finder.pos.lineno]->text); |
13 |
|
14 |
file_finder_done(&finder); |