From: Neal Norwitz Date: Fri, 13 Sep 2002 14:40:50 +0000 (+0000) Subject: SF # 602108 ensure string is null terminated after strncpy X-Git-Tag: v2.2.2b1~172 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=163262e33630ad35fd121f583ca95c9e3c0ff558;p=thirdparty%2FPython%2Fcpython.git SF # 602108 ensure string is null terminated after strncpy --- diff --git a/Modules/getpath.c b/Modules/getpath.c index 3ecdb9d7d883..1841c76bcce4 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.