summaryrefslogtreecommitdiffstats
path: root/Modules/getpath.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2002-09-13 14:35:56 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2002-09-13 14:35:56 (GMT)
commitbcf9f9eb3bde3cdac05402d27277d8c40839e4fe (patch)
treec4e705246ca8a39bd567c43cd137e52752802a96 /Modules/getpath.c
parent12e96689894d81be290a51d9e62c138ac1230acd (diff)
downloadcpython-bcf9f9eb3bde3cdac05402d27277d8c40839e4fe.zip
cpython-bcf9f9eb3bde3cdac05402d27277d8c40839e4fe.tar.gz
cpython-bcf9f9eb3bde3cdac05402d27277d8c40839e4fe.tar.bz2
SF # 602108 ensure string is null terminated after strncpy
Diffstat (limited to 'Modules/getpath.c')
-rw-r--r--Modules/getpath.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/getpath.c b/Modules/getpath.c
index 3ecdb9d..1841c76b 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -407,6 +407,7 @@ calculate_path(void)
if (progpath[0] != SEP)
absolutize(progpath);
strncpy(argv0_path, progpath, MAXPATHLEN);
+ argv0_path[MAXPATHLEN] = '\0';
#ifdef WITH_NEXT_FRAMEWORK
/* On Mac OS X we have a special case if we're running from a framework.