Make sure zip_path is null-terminated, since it's on the stack
authorNeal Norwitz <nnorwitz@gmail.com>
Tue, 31 Dec 2002 12:35:41 +0000 (12:35 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Tue, 31 Dec 2002 12:35:41 +0000 (12:35 +0000)
PC/getpathp.c

index 4930ad825837412705907f3634af5b15ca7f01c3..ed0a75552236b197527c50327ca66a1bf1a579ff 100644 (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" */