(svn r14414) -Fix: replace instances of strncpy with strecpy as strncpy doesn't guarantee the resulting string is '\0'-terminated.

This commit is contained in:
rubidium
2008-09-29 16:27:02 +00:00
parent d34da3cadb
commit 5ab74534da
10 changed files with 14 additions and 11 deletions

View File

@@ -633,7 +633,7 @@ static bool TarListAddFile(const char *filename)
} else {
/* Append at end of 'dest' */
if (destpos != dest) *(destpos++) = PATHSEPCHAR;
strncpy(destpos, pos, next - pos);
strncpy(destpos, pos, next - pos); // Safe as we do '\0'-termination ourselves
destpos += next - pos;
}
*destpos = '\0';