From: Peter Howkins Date: Mon, 2 Jul 2018 21:48:20 +0000 (+0100) Subject: libDtSearch: Coverity 86698 X-Git-Tag: 2.3.0a~257 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=68986baef823c9e705d554512f46225746bdbf87;p=oweals%2Fcde.git libDtSearch: Coverity 86698 --- 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 */