From: Jon Trulson Date: Mon, 2 Apr 2018 22:37:40 +0000 (-0600) Subject: libDtSearch/dtsrapi.c: Coverity CID 86857; dest buf too small X-Git-Tag: 2.2.4a~132^2~8 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4e61c627420d8100c5e6012874e6091dfea25983;p=oweals%2Fcde.git libDtSearch/dtsrapi.c: Coverity CID 86857; dest buf too small --- diff --git a/cde/lib/DtSearch/dtsrapi.c b/cde/lib/DtSearch/dtsrapi.c index d16e7e66..ae09523f 100644 --- a/cde/lib/DtSearch/dtsrapi.c +++ b/cde/lib/DtSearch/dtsrapi.c @@ -543,7 +543,8 @@ int DtSearchQuery ( LLIST *llp; enum { TEXT, NAVSTRING, FZKEYI } qryarg; - char date1str[24]; +# define _DATE1STR_LEN (24) + char date1str[_DATE1STR_LEN]; if (!valid_dbname (dbname)) return DtSrREINIT; @@ -621,7 +622,8 @@ QUERY_ERROR: *ptr++ = ' '; } *(--ptr) = 0; - strcpy (date1str, objdate2fzkstr (usrblk.objdate1)); + strncpy(date1str, objdate2fzkstr (usrblk.objdate1), _DATE1STR_LEN); + date1str[_DATE1STR_LEN - 1] = 0; fprintf (aa_stderr, PROGNAME "353 DtSearchQuery(): dbname='%s' srchtype='%c'\n" " maxhits=%d keytypes='%s'\n"