File: 02-Fix-potential-access-violation.patch

package info (click to toggle)
menu-cache 1.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,000 kB
  • ctags: 776
  • sloc: sh: 11,269; ansic: 4,944; makefile: 152
file content (20 lines) | stat: -rw-r--r-- 704 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Author: Andriy Grytsenko <andrej@rep.kiev.ua>
Description: Fix potential access violation, use runtime user dir instead of tmp dir. (Closes: #862570)
Applied-Upstream: 56f66684592abf257c4004e6e1fff041c64a12ce

--- a/libmenu-cache/menu-cache.c
+++ b/libmenu-cache/menu-cache.c
@@ -1538,8 +1538,13 @@ static void get_socket_name( char* buf, int len )
         if(*p)
             *p = '\0';
     }
+#if GLIB_CHECK_VERSION(2, 28, 0)
+    g_snprintf( buf, len, "%s/menu-cached-%s", g_get_user_runtime_dir(),
+                dpy ? dpy : ":0" );
+#else
     g_snprintf( buf, len, "%s/.menu-cached-%s-%s", g_get_tmp_dir(),
                 dpy ? dpy : ":0", g_get_user_name() );
+#endif
     g_free(dpy);
 }