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

index 03646a541960a8b78c273d29a96767b6a21d8a65..6559b0615bcd98a647fd5ee0cc75b87d694e9f96 100644 (file)
@@ -485,6 +485,7 @@ calculate_path(void)
         reduce(prefix);
 
     strncpy(zip_path, prefix, MAXPATHLEN);
+    zip_path[MAXPATHLEN] = '\0';
     if (pfound > 0) { /* Use the reduced prefix returned by Py_GetPrefix() */
         reduce(zip_path);
         reduce(zip_path);