Make sure zip_path is null-terminated, since it's on the stack

This commit is contained in:
Neal Norwitz 2002-12-31 12:35:41 +00:00
parent ee711092eb
commit a8aed02f1e
1 changed files with 1 additions and 0 deletions

View File

@ -467,6 +467,7 @@ calculate_path(void)
strncpy(zip_path, dllpath, MAXPATHLEN);
else /* use name of executable program */
strncpy(zip_path, progpath, MAXPATHLEN);
zip_path[MAXPATHLEN] = '\0';
len = strlen(zip_path);
if (len > 4) {
zip_path[len-3] = 'z'; /* change ending to "zip" */