21e434dca9d563fce9129c7fcfa6deae8ecd08fc
[debian/pcmanfm.git] / debian / patches / 01-Fix-potential-access-violation.patch
1 Author: Andriy Grytsenko <andrej@rep.kiev.ua>
2 Description: Fix potential access violation, use runtime user dir instead of tmp dir. (Closes: #862571)
3 Applied-Upstream: bc8c3d871e9ecc67c47ff002b68cf049793faf08
4
5 --- a/src/single-inst.c
6 +++ b/src/single-inst.c
7 @@ -404,11 +404,16 @@ static void get_socket_name(SingleInstData* data, char* buf, int len)
8      }
9      else
10          dpynum = 0;
11 +#if GLIB_CHECK_VERSION(2, 28, 0)
12 +    g_snprintf(buf, len, "%s/%s-socket-%s-%d", g_get_user_runtime_dir(),
13 +               data->prog_name, host ? host : "", dpynum);
14 +#else
15      g_snprintf(buf, len, "%s/.%s-socket-%s-%d-%s",
16                  g_get_tmp_dir(),
17                  data->prog_name,
18                  host ? host : "",
19                  dpynum,
20                  g_get_user_name());
21 +#endif
22  }
23