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,6 +601,7 @@ find_auth_cookie (FILE *f)
|
||||
Xauth *ret = NULL;
|
||||
char local_hostname[MaxHostNameLen];
|
||||
char *display = getenv("DISPLAY");
|
||||
char d[MaxHostNameLen + 4];
|
||||
char *colon;
|
||||
struct addrinfo *ai;
|
||||
struct addrinfo hints;
|
||||
@@ -609,6 +610,8 @@ find_auth_cookie (FILE *f)
|
||||
|
||||
if(display == NULL)
|
||||
display = ":0";
|
||||
strlcpy(d, display, sizeof(d));
|
||||
display = d;
|
||||
colon = strchr (display, ':');
|
||||
if (colon == NULL)
|
||||
disp = 0;
|
||||
|
Reference in New Issue
Block a user