mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
FileUtils.c: fix CERT VU#575804
This commit is contained in:
parent
c0f9270dd3
commit
8e4e53f4b9
1 changed files with 6 additions and 3 deletions
|
@ -453,7 +453,8 @@ char * _DtHelpFileLocate (
|
||||||
/*** this is monstrously inefficient--but it shouldn't get called often ***/
|
/*** this is monstrously inefficient--but it shouldn't get called often ***/
|
||||||
|
|
||||||
/* get user's current working directory */
|
/* get user's current working directory */
|
||||||
if (getcwd(tmpPath, MAXPATHLEN) == NULL) return NULL; /* RETURN: error */
|
/* JET - CERT VU#575804 */
|
||||||
|
if (getcwd(tmpPath, MAXPATHLEN - 1) == NULL) return NULL; /* RETURN: error */
|
||||||
|
|
||||||
/* make path end in a slash */
|
/* make path end in a slash */
|
||||||
eos = tmpPath + strlen(tmpPath);
|
eos = tmpPath + strlen(tmpPath);
|
||||||
|
@ -530,7 +531,9 @@ char * _DtHelpFileLocate (
|
||||||
*ptr = EOS;
|
*ptr = EOS;
|
||||||
|
|
||||||
/* compress that path */
|
/* compress that path */
|
||||||
strcpy(tmpPath,curPath);
|
/* JET - CERT VU#575804 */
|
||||||
|
strncpy(tmpPath, curPath, MAXPATHLEN);
|
||||||
|
|
||||||
_DtHelpCeCompressPathname(tmpPath);
|
_DtHelpCeCompressPathname(tmpPath);
|
||||||
|
|
||||||
/* test all suffixes */
|
/* test all suffixes */
|
||||||
|
|
Loading…
Reference in a new issue