aboutsummaryrefslogtreecommitdiff
path: root/debian/patches/use-g_strdup.patch
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-10-09 17:57:05 -0400
committerB. Stack <bgstack15@gmail.com>2022-10-09 17:57:05 -0400
commita7738f4dc72c9445623cd6f5348d7a80d4e52690 (patch)
treeb336daf9b226783c39e6e985410cecf46484de3d /debian/patches/use-g_strdup.patch
downloadfbxkb-a7738f4dc72c9445623cd6f5348d7a80d4e52690.tar.gz
fbxkb-a7738f4dc72c9445623cd6f5348d7a80d4e52690.tar.bz2
fbxkb-a7738f4dc72c9445623cd6f5348d7a80d4e52690.zip
initial commit, straight from apt-get source
Diffstat (limited to 'debian/patches/use-g_strdup.patch')
-rw-r--r--debian/patches/use-g_strdup.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/debian/patches/use-g_strdup.patch b/debian/patches/use-g_strdup.patch
new file mode 100644
index 0000000..9651da2
--- /dev/null
+++ b/debian/patches/use-g_strdup.patch
@@ -0,0 +1,25 @@
+Description: Use g_strdup() to pass strings to g_hash_table_insert()
+ Otherwise use-after-free happens soon.
+Author: Dmitry Borisyuk <q1werty@i.com.ua>
+--- a/fbxkb.c
++++ b/fbxkb.c
+@@ -266,7 +266,6 @@
+ {
+ GdkPixbuf *flag;
+ static GString *s = NULL;
+- char tmp[3];
+
+ ENTER;
+ g_assert(sym != NULL && strlen(sym) > 1);
+@@ -281,10 +280,7 @@
+ flag = gdk_pixbuf_new_from_file_at_size(s->str, 24, 24, NULL);
+ if (!flag)
+ RET(zzflag);
+- tmp[0] = sym[0];
+- tmp[1] = sym[1];
+- tmp[2] = 0;
+- g_hash_table_insert(sym2pix, tmp, flag);
++ g_hash_table_insert(sym2pix, g_strdup(sym), flag);
+ RET(flag);
+ }
+
bgstack15