From 68986baef823c9e705d554512f46225746bdbf87 Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Mon, 2 Jul 2018 22:48:20 +0100 Subject: [PATCH] libDtSearch: Coverity 86698 --- cde/lib/DtSearch/raima/pathfcns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cde/lib/DtSearch/raima/pathfcns.c b/cde/lib/DtSearch/raima/pathfcns.c index 18c5943b..75a2dd78 100644 --- a/cde/lib/DtSearch/raima/pathfcns.c +++ b/cde/lib/DtSearch/raima/pathfcns.c @@ -294,7 +294,7 @@ char *path_str /* Path to remove filename from */ /* There is only a filename if string does not contain a DIRCHAR or ':' which separates drive spec from path. */ if (path_str == NULL) return (NULL); - strcpy(dirpath,path_str); /* Copy into output string */ + snprintf(dirpath, sizeof(dirpath), "%s", path_str); /* Copy into output string */ if ((path_str = strrchr(dirpath,DIRCHAR)) == NULL) if ((path_str = strrchr(dirpath,':')) == NULL) return (NULL); path_str[1] = '\0'; /* Truncate string */ -- 2.25.1