]> granicus.if.org Git - python/commitdiff
SF # 602108 ensure string is null terminated after strncpy
authorNeal Norwitz <nnorwitz@gmail.com>
Fri, 13 Sep 2002 14:35:56 +0000 (14:35 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Fri, 13 Sep 2002 14:35:56 +0000 (14:35 +0000)
Modules/getpath.c

index 3ecdb9d7d8830d5a98c6ab6b0a70e427008a3ebf..1841c76bcce421e308db6de5ce18a7f7e2b1f724 100644 (file)
@@ -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.