dtscreen: Coverity (memory corruption, moderate)
authorJon Trulson <jon@radscan.com>
Sat, 27 Dec 2014 00:17:58 +0000 (17:17 -0700)
committerJon Trulson <jon@radscan.com>
Sat, 27 Dec 2014 00:17:58 +0000 (17:17 -0700)
cde/programs/dtscreen/resource.c

index 685207bd1b648a605f5ffebd19a8bcb07a2021f6..c48ef550498abea1b9834a05957622e7352b233c 100644 (file)
@@ -623,9 +623,9 @@ GetResources(argc, argv)
     if (!userpath) {
        env = getenv("XAPPLRESDIR");
        if (env)
-           sprintf(userfile, "%s/%%N:%s/%%N", env, homeenv);
+          snprintf(userfile, 1024 - 1, "%s/%%N:%s/%%N", env, homeenv);
        else
-           sprintf(userfile, "%s/%%N", homeenv);
+          snprintf(userfile, 1024 - 1, "%s/%%N", homeenv);
        userpath = userfile;
     }
     userDB = parsefilepath(userpath, "app-defaults", classname);