ui: fix crash due to out-of-bounds array access
commit718c6e94fcc111e5607d6ca0bf3d15271adc0d97
authorEric Sunshine <sunshine@sunshineco.com>
Thu, 9 Apr 2015 08:37:19 +0000 (9 04:37 -0400)
committerJonas Fonseca <jonas.fonseca@gmail.com>
Thu, 9 Apr 2015 11:44:31 +0000 (9 07:44 -0400)
tree91595296c9c7b7a56e89823642c5c50517974a3f
parent09fb65c07b7959c1136f1eb563ace5e05891d754
ui: fix crash due to out-of-bounds array access

If the search string typed at the "Find file:" prompt in the file finder
does not match any files, then the resulting file list is empty. When
ENTER is pressed, open_file_finder() attempts to retrieve the
non-existent entry at index 0 in the empty list, often resulting in a
crash. Fix this boundary condition error.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Jonas Fonseca <jonas.fonseca@gmail.com>
src/ui.c