dtwm: Coverity 88535
authorPeter Howkins <flibble@users.sf.net>
Mon, 2 Jul 2018 19:58:16 +0000 (20:58 +0100)
committerPeter Howkins <flibble@users.sf.net>
Mon, 2 Jul 2018 19:58:16 +0000 (20:58 +0100)
cde/programs/dtwm/WmImage.c

index 0c043572e186a6323571dc2e9015ad30ee21a3a6..ab98c03feba04c4eb60c5d144137298c024022b3 100644 (file)
@@ -989,8 +989,7 @@ char *BitmapPathName (char *string)
      * Handle "~/.." 
      */
     {
-       strcpy (fileName, homeDir);
-        strncat (fileName, &(string[1]), MAXWMPATH - strlen (fileName));
+       snprintf(fileName, MAXWMPATH, "%s%s", homeDir, &(string[1]));
        return (fileName);
     }