From 0843325a437656e63116207b505d42c3114481a5 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sun, 1 Apr 2018 14:04:25 -0600 Subject: [PATCH] dtcm/props.c: coverity CID 88573; unbounded src buf --- cde/programs/dtcm/libDtCmP/props.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cde/programs/dtcm/libDtCmP/props.c b/cde/programs/dtcm/libDtCmP/props.c index c935c579..d213cd31 100644 --- a/cde/programs/dtcm/libDtCmP/props.c +++ b/cde/programs/dtcm/libDtCmP/props.c @@ -56,6 +56,7 @@ static char sccsid[] = "@(#)props.c 1.13 94/11/07 Copyr 1991 Sun Microsystems, I #include #include #include +#include #include "props.h" #include "util.h" @@ -435,12 +436,13 @@ save_props(Props *p) } if (ds_def) - sprintf(buf, "%s", ds_def); + snprintf(buf, MAXPATHLEN, "%s", ds_def); else if (getenv("HOME") != NULL) - sprintf(buf, "%s%s", getenv("HOME"), DS_FILENAME); + snprintf(buf, MAXPATHLEN, "%s%s", + getenv("HOME"), DS_FILENAME); else - sprintf(buf, "/%s", DS_FILENAME); + snprintf(buf, MAXPATHLEN, "/%s", DS_FILENAME); return (save_resources(p->rdb, buf)); } -- 2.25.1