From 5a8c87771defa525d21b75703ac6d717e44c2f0872726ad33267e6ac3aa53623 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 8 Sep 2020 08:48:52 +0000 Subject: [PATCH] Accepting request 828156 from home:jirislaby:branches:Base:System - add libkeymap-Fix-mk_mapname-for-the-plain-map.patch OBS-URL: https://build.opensuse.org/request/show/828156 OBS-URL: https://build.opensuse.org/package/show/Base:System/kbd?expand=0&rev=125 --- kbd.changes | 5 ++ kbd.spec | 2 + ...map-Fix-mk_mapname-for-the-plain-map.patch | 52 +++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 libkeymap-Fix-mk_mapname-for-the-plain-map.patch diff --git a/kbd.changes b/kbd.changes index 3fff5f4..3fd4cf5 100644 --- a/kbd.changes +++ b/kbd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 20 11:34:32 UTC 2020 - Jiri Slaby + +- add libkeymap-Fix-mk_mapname-for-the-plain-map.patch + ------------------------------------------------------------------- Tue Apr 21 13:08:11 UTC 2020 - Ludwig Nussel diff --git a/kbd.spec b/kbd.spec index c6e68e4..84e83ef 100644 --- a/kbd.spec +++ b/kbd.spec @@ -69,6 +69,7 @@ Patch13: kbd-1.15.5-loadkeys-search-path.patch Patch14: kbdsettings-nox86.patch # PATCH-FIX-SLE kbd-unicode-fxxx.patch sbrabec@suse.com bsc1085432 -- Do not cause error on UNICODE characters >= 0xF000 (e. g. ligature fi) Patch15: kbd-unicode-fxxx.patch +Patch16: libkeymap-Fix-mk_mapname-for-the-plain-map.patch BuildRequires: automake BuildRequires: bison BuildRequires: check-devel @@ -133,6 +134,7 @@ cp -fp %{SOURCE22} . %patch14 -p0 %endif %patch15 -p1 +%patch16 -p1 %build for i in `find data/keymaps/mac -type f` ; do diff --git a/libkeymap-Fix-mk_mapname-for-the-plain-map.patch b/libkeymap-Fix-mk_mapname-for-the-plain-map.patch new file mode 100644 index 0000000..d4de72d --- /dev/null +++ b/libkeymap-Fix-mk_mapname-for-the-plain-map.patch @@ -0,0 +1,52 @@ +From: Alexey Gladkov +Date: Sun, 23 Feb 2020 18:24:59 +0100 +Subject: libkeymap: Fix mk_mapname for the plain map +Patch-mainline: 2.3 +Git-commit: 88ae58fe8a223d11307accc36cc293133a18e7ac + +mk_mapname did not correctly return "plain" for the plain map (no modifier set) +if it had already been called, as it did not correctly reset the static buffer +that it uses for the map name. When mk_mapname is called for the first time +from the first loop in lk_dump_ctable, all is fine, since buf has not been used +yet and it is initialised to 0. However, when it is called again for the plain +map from the second loop in lk_dump_ctable, buf already contains a value (left +over from the last iteration in the first loop), and then strcat appends +"plain" to that value instead of overwriting it, resulting in a bogus value. + +Reported-by: Javier Pello +Signed-off-by: Alexey Gladkov +Signed-off-by: Jiri Slaby +--- + src/libkeymap/dump.c | 2 +- + tests/data/dumpkeys-mktable/defkeymap.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/libkeymap/dump.c b/src/libkeymap/dump.c +index 8531b5aa3d91..d67eefaada54 100644 +--- a/src/libkeymap/dump.c ++++ b/src/libkeymap/dump.c +@@ -101,7 +101,7 @@ mk_mapname(char modifier) + int i; + + if (!modifier) { +- strcat(buf, "plain"); ++ strcpy(buf, "plain"); + return buf; + } + buf[0] = 0; +diff --git a/tests/data/dumpkeys-mktable/defkeymap.c b/tests/data/dumpkeys-mktable/defkeymap.c +index e831316a1ff3..5d9a3aaeff8c 100644 +--- a/tests/data/dumpkeys-mktable/defkeymap.c ++++ b/tests/data/dumpkeys-mktable/defkeymap.c +@@ -565,7 +565,7 @@ static unsigned short shift_altgr_ctrl_alt_map[NR_KEYS] = { + }; + + ushort *key_maps[MAX_NR_KEYMAPS] = { +- shift_altgr_ctrl_altplain_map, shift_map, altgr_map, shift_altgr_map, ++ plain_map, shift_map, altgr_map, shift_altgr_map, + ctrl_map, shift_ctrl_map, altgr_ctrl_map, shift_altgr_ctrl_map, + alt_map, shift_alt_map, altgr_alt_map, shift_altgr_alt_map, + ctrl_alt_map, shift_ctrl_alt_map, altgr_ctrl_alt_map, shift_altgr_ctrl_alt_map, 0 +-- +2.28.0 +