From: Jon Trulson Date: Fri, 26 Dec 2014 23:17:43 +0000 (-0700) Subject: dtcalc: Coverity (memory corruption, moderate) X-Git-Tag: 2.2.3~73 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ff3cd78ac0fc15465205b7dad4d191db487d54e5;p=oweals%2Fcde.git dtcalc: Coverity (memory corruption, moderate) --- diff --git a/cde/programs/dtcalc/calctool.c b/cde/programs/dtcalc/calctool.c index 44e5aaad..3615055a 100644 --- a/cde/programs/dtcalc/calctool.c +++ b/cde/programs/dtcalc/calctool.c @@ -1638,10 +1638,10 @@ read_rcfiles(void) /* Read .dtcalcrc's from home and current directories. */ if ((entry = getpwuid(getuid())) == NULL) return ; home = entry->pw_dir ; } - SPRINTF(name, "%s/%s", home, RCNAME) ; + snprintf(name, MAXPATHLEN, "%s/%s", home, RCNAME) ; get_rcfile(name) ; /* Read .dtcalcrc from users home directory. */ - SPRINTF(name, "%s/%s", getcwd(pathname, MAXPATHLEN+1), RCNAME) ; + snprintf(name, MAXPATHLEN, "%s/%s", getcwd(pathname, MAXPATHLEN+1), RCNAME) ; get_rcfile(name) ; /* Read .dtcalcrc file from current directory. */ }