Merge tag 'upstream/2.5'
[xfishtank.git] / debian / patches / do-not-assume-environment-contains-display.patch
CommitLineData
cb68cd21
MG
1Description: Do not assume that the environment contains a DISPLAY variable
2 Previously, the code unconditionally tried to copy it to a variable.
3 This segfaults when that variable does not exist.
4Author: Marius Gavrilescu <marius@ieval.ro>
5Bug-Debian: http://bugs.debian.org/716500
6Forwarded: https://github.com/jim-rees/xfishtank/issues/5
7Bug: https://github.com/jim-rees/xfishtank/issues/5
8Last-Update: 2013-07-11
9
10--- xfishtank-2.3.orig/xfish.c
11+++ xfishtank-2.3/xfish.c
12@@ -171,12 +171,14 @@ int argc;
13 char **argv;
14 {
15 int c, i;
16+ const char *display = getenv("DISPLAY");
17 extern int optind;
18 extern char *optarg;
19 extern double atof();
20
21 pname = argv[0];
22- strncpy(sname, getenv("DISPLAY"), sizeof(sname) - 1);
23+ if(display != NULL)
24+ strncpy(sname, display, sizeof(sname) - 1);
25 strcpy(cname, "MediumAquamarine");
26
27 while ((c = getopt(argc, argv, "dDob:C:c:p:m:f:i:r:s")) != EOF) {
This page took 0.010114 seconds and 4 git commands to generate.