]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Properly terminate file name.
authorMartin v. Löwis <martin@v.loewis.de>
Sat, 22 Mar 2008 22:07:13 +0000 (22:07 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sat, 22 Mar 2008 22:07:13 +0000 (22:07 +0000)
Python/import.c

index 8f8341038b96a40f792379a9fc55dae1f8165857..d201dae54fba0f6ffeac640007e5e64b7acb74f5 100644 (file)
@@ -997,7 +997,7 @@ get_sourcefile(const char *file)
        }
 
        strncpy(py, file, len-1);
-       py[len] = '\0';
+       py[len-1] = '\0';
        if (stat(py, &statbuf) == 0 &&
                S_ISREG(statbuf.st_mode)) {
                u = PyUnicode_DecodeFSDefault(py);