1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

Fix null dereference in readline initialization

* guile-readline/readline.c (init_bouncing_parens): Check that the keymap is
  valid before using it.
This commit is contained in:
Daniel Llorens 2021-05-27 11:56:24 +02:00
parent 17aab66e75
commit c1fd55d174

View file

@ -431,12 +431,17 @@ static void init_bouncing_parens ();
static void
init_bouncing_parens ()
{
if (strncmp (rl_get_keymap_name (rl_get_keymap ()), "vi", 2))
{
rl_bind_key (')', match_paren);
rl_bind_key (']', match_paren);
rl_bind_key ('}', match_paren);
}
Keymap km = rl_get_keymap ();
if (km)
if (strncmp (rl_get_keymap_name (km), "vi", 2))
{
rl_bind_key (')', match_paren);
rl_bind_key (']', match_paren);
rl_bind_key ('}', match_paren);
}
else
scm_error (scm_misc_error_key, "", "readline has not been properly initialized",
SCM_EOL, SCM_EOL);
}
static int