From ff3cd78ac0fc15465205b7dad4d191db487d54e5 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Fri, 26 Dec 2014 16:17:43 -0700 Subject: [PATCH] dtcalc: Coverity (memory corruption, moderate) --- cde/programs/dtcalc/calctool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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. */ } -- 2.25.1