From 4ee5f3d3cf90b76135cb6d410c0dde5db0ef6f08 Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Wed, 4 Jul 2018 01:26:39 +0100 Subject: [PATCH] dtcm: Coverity 89265 --- cde/programs/dtcm/server/svcmain.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cde/programs/dtcm/server/svcmain.c b/cde/programs/dtcm/server/svcmain.c index c917922c..8b9b27fa 100644 --- a/cde/programs/dtcm/server/svcmain.c +++ b/cde/programs/dtcm/server/svcmain.c @@ -327,14 +327,11 @@ lock_it(void) locker.l_len = 0; #endif /* SVR4 */ - strcpy (buff, dir); - strcat (buff, "/.lock."); - /* * /var/spool might be mounted. Use .lock.hostname to * prevent more than one cms running in each host. */ - strcat(buff, _DtCmGetLocalHost()); + snprintf(buff, sizeof(buff), "%s/.lock.%s", dir, _DtCmGetLocalHost()); fd = open(buff, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); if (fd < 0) -- 2.25.1