A SIGINT received during get_y_or_n in display_matches can leave
rl_display_match_list working with an already-freed matches array.

The check below should prevent this:

diff --git a/lib/readline/complete.c b/lib/readline/complete.c
index 2016d393..d6dd7dca 100644
--- a/lib/readline/complete.c
+++ b/lib/readline/complete.c
@@ -1745,7 +1745,8 @@ display_matches (char **matches)
  }
     }

-  rl_display_match_list (matches, len, max);
+  if (_rl_complete_display_matches_interrupt == 0)
+    rl_display_match_list (matches, len, max);

   rl_forced_update_display ();
   rl_display_fixed = 1;

Reply via email to