This is an automated email from the git hooks/post-receive script.
lloda pushed a commit to branch main
in repository guile.
The following commit(s) were added to refs/heads/main by this push:
new c1fd55d Fix null dereference in readline initialization
c1fd55d is described below
commit c1fd55d1747880ff2ea822e88a1c41482181cb49
Author: Daniel Llorens <[email protected]>
AuthorDate: Thu May 27 11:56:24 2021 +0200
Fix null dereference in readline initialization
* guile-readline/readline.c (init_bouncing_parens): Check that the keymap is
valid before using it.
---
guile-readline/readline.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/guile-readline/readline.c b/guile-readline/readline.c
index 469d6ec..408ca55 100644
--- a/guile-readline/readline.c
+++ b/guile-readline/readline.c
@@ -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