From 489cb059c28825ca50fcdaff2f97cd570748bbcc Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 8 Dec 2012 14:42:58 +0000 Subject: [PATCH] fish: Don't segfault here is 'words' happens to be NULL (found by Coverity). --- fish/destpaths.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fish/destpaths.c b/fish/destpaths.c index bc355ccc6..32aaaece4 100644 --- a/fish/destpaths.c +++ b/fish/destpaths.c @@ -214,7 +214,8 @@ complete_dest_paths_generator (const char *text, int state) rl_attempted_completion_over = 1; /* Sort the words so the list is stable over multiple calls. */ - qsort (words, nr_words, sizeof (struct word), compare_words); + if (words) + qsort (words, nr_words, sizeof (struct word), compare_words); /* Complete the string. */ while (index < nr_words) {