Skip to contentSkip to conversation

keytable: keymap without protocol is invalid

PATCH New Sean Young 1 participant 1 message Jan 21, 2020 Media (V4L/DVB)

lore
Share & tools
lore

Sean Young

author
#0 lore raw

PATCH 1/1 keytable: keymap without protocol is invalid

Without a protocol, keymap cannot be loaded and causes a segfault.

---
 utils/common/keymap.c | 5 +++++
 1 file changed, 5 insertions(+)
utils/common/keymap.c +5 -0
index d06deb59..6ca33745 100644
@@ -169,6 +169,11 @@ static error_t parse_plain_keymap(char *fname, struct keymap **keymap, bool verb
 	}
 	fclose(fin);
 
+	if (!map->protocol) {
+		fprintf(stderr, _("Missing protocol in %s\n"), fname);
+		return EINVAL;
+	}
+
 	*keymap = map;
 
 	return 0;
Signature · 1 line
2.24.1