From: Neal Norwitz Date: Tue, 31 Dec 2002 12:45:12 +0000 (+0000) Subject: Make sure zip_path is null-terminated, since it's on the stack X-Git-Tag: v2.3c1~2731 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b70557f13dc3fe40f1a0e604855acf3e41500c97;p=thirdparty%2FPython%2Fcpython.git Make sure zip_path is null-terminated, since it's on the stack --- diff --git a/Modules/getpath.c b/Modules/getpath.c index 03646a541960..6559b0615bcd 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -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);