From aa6d1129b336af4f95636bac0b3d857c4c698179 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Wed, 21 Apr 2010 21:53:56 -0400 Subject: [PATCH] Fix set_keymap to error when resolving an unknown keymap The underlying interface was changed in commit f50084da to return TRUE/FALSE instead of OK/ERR, but the only usage of set_keymap was not updated. This lead to a potential segmentation fault. Reported by Simon Ruderich. --- NEWS | 1 + tig.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index b3eeb49..59d7489 100644 --- a/NEWS +++ b/NEWS @@ -30,6 +30,7 @@ Bug fixes: - Fix parsing of boolean show-date values. - Fix relative date. - Fix unbind to behave as if the keybinding was never defined. + - Fix parsing of unknown keymap names. tig-0.15 -------- diff --git a/tig.c b/tig.c index 7cdd3ea..49ef437 100644 --- a/tig.c +++ b/tig.c @@ -2009,7 +2009,7 @@ option_bind_command(int argc, const char *argv[]) return ERR; } - if (set_keymap(&keymap, argv[0]) == ERR) { + if (!set_keymap(&keymap, argv[0])) { config_msg = "Unknown key map"; return ERR; } -- 2.30.2