don't write to string constants
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9475 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -601,14 +601,17 @@ find_auth_cookie (FILE *f)
|
|||||||
Xauth *ret = NULL;
|
Xauth *ret = NULL;
|
||||||
char local_hostname[MaxHostNameLen];
|
char local_hostname[MaxHostNameLen];
|
||||||
char *display = getenv("DISPLAY");
|
char *display = getenv("DISPLAY");
|
||||||
|
char d[MaxHostNameLen + 4];
|
||||||
char *colon;
|
char *colon;
|
||||||
struct addrinfo *ai;
|
struct addrinfo *ai;
|
||||||
struct addrinfo hints;
|
struct addrinfo hints;
|
||||||
int disp;
|
int disp;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
if (display == NULL)
|
if(display == NULL)
|
||||||
display = ":0";
|
display = ":0";
|
||||||
|
strlcpy(d, display, sizeof(d));
|
||||||
|
display = d;
|
||||||
colon = strchr (display, ':');
|
colon = strchr (display, ':');
|
||||||
if (colon == NULL)
|
if (colon == NULL)
|
||||||
disp = 0;
|
disp = 0;
|
||||||
|
Reference in New Issue
Block a user