mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Make sure zip_path is null-terminated, since it's on the stack
This commit is contained in:
parent
ee711092eb
commit
a8aed02f1e
1 changed files with 1 additions and 0 deletions
|
@ -467,6 +467,7 @@ calculate_path(void)
|
||||||
strncpy(zip_path, dllpath, MAXPATHLEN);
|
strncpy(zip_path, dllpath, MAXPATHLEN);
|
||||||
else /* use name of executable program */
|
else /* use name of executable program */
|
||||||
strncpy(zip_path, progpath, MAXPATHLEN);
|
strncpy(zip_path, progpath, MAXPATHLEN);
|
||||||
|
zip_path[MAXPATHLEN] = '\0';
|
||||||
len = strlen(zip_path);
|
len = strlen(zip_path);
|
||||||
if (len > 4) {
|
if (len > 4) {
|
||||||
zip_path[len-3] = 'z'; /* change ending to "zip" */
|
zip_path[len-3] = 'z'; /* change ending to "zip" */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue