From 458b7cead4a2988204b0d9700a0ffc2fd6140ebf Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 15 Sep 2011 02:26:04 +0000 Subject: Add kdmtsak program Fix possible kompmgr segfault under rare circumstances git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1253695 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kwin/kompmgr/kompmgr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'kwin') diff --git a/kwin/kompmgr/kompmgr.c b/kwin/kompmgr/kompmgr.c index 3bb0a856a..decfb6853 100644 --- a/kwin/kompmgr/kompmgr.c +++ b/kwin/kompmgr/kompmgr.c @@ -389,7 +389,8 @@ void delete_pid_file() printf("kompmgr lost connection to X server, restarting...\n\r"); fflush(stdout); sleep(1); char me[2048]; - readlink("/proc/self/exe", me, sizeof(me)); + int chars = readlink("/proc/self/exe", me, sizeof(me)); + me[chars] = 0; me[2047] = 0; execl(me, NULL); } -- cgit v1.2.1