From 63941620b2c513380b223c8e351137a504cd2ac6 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Wed, 17 Jan 2001 10:09:16 +0000 Subject: [PATCH] don't write to string constants git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9475 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/kx/common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/appl/kx/common.c b/appl/kx/common.c index d1c7aa996..c493b1bb3 100644 --- a/appl/kx/common.c +++ b/appl/kx/common.c @@ -601,14 +601,17 @@ 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; int disp; int error; - if (display == NULL) + if(display == NULL) display = ":0"; + strlcpy(d, display, sizeof(d)); + display = d; colon = strchr (display, ':'); if (colon == NULL) disp = 0;