Adding 01-Fix-potential-access-violation.patch from upstream (Closes: #862571).
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Sun, 14 May 2017 20:25:08 +0000 (23:25 +0300)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Sun, 14 May 2017 20:25:08 +0000 (23:25 +0300)
debian/patches/01-Fix-potential-access-violation.patch [new file with mode: 0644]
debian/patches/series [new file with mode: 0644]

diff --git a/debian/patches/01-Fix-potential-access-violation.patch b/debian/patches/01-Fix-potential-access-violation.patch
new file mode 100644 (file)
index 0000000..21e434d
--- /dev/null
@@ -0,0 +1,23 @@
+Author: Andriy Grytsenko <andrej@rep.kiev.ua>
+Description: Fix potential access violation, use runtime user dir instead of tmp dir. (Closes: #862571)
+Applied-Upstream: bc8c3d871e9ecc67c47ff002b68cf049793faf08
+
+--- a/src/single-inst.c
++++ b/src/single-inst.c
+@@ -404,11 +404,16 @@ static void get_socket_name(SingleInstData* data, char* buf, int len)
+     }
+     else
+         dpynum = 0;
++#if GLIB_CHECK_VERSION(2, 28, 0)
++    g_snprintf(buf, len, "%s/%s-socket-%s-%d", g_get_user_runtime_dir(),
++               data->prog_name, host ? host : "", dpynum);
++#else
+     g_snprintf(buf, len, "%s/.%s-socket-%s-%d-%s",
+                 g_get_tmp_dir(),
+                 data->prog_name,
+                 host ? host : "",
+                 dpynum,
+                 g_get_user_name());
++#endif
+ }
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644 (file)
index 0000000..82e7a5a
--- /dev/null
@@ -0,0 +1 @@
+01-Fix-potential-access-violation.patch