]> granicus.if.org Git - python/commitdiff
Fix potential crash in path manipulation on windows
authorKristján Valur Jónsson <kristjan@ccpgames.com>
Fri, 13 Apr 2007 22:21:07 +0000 (22:21 +0000)
committerKristján Valur Jónsson <kristjan@ccpgames.com>
Fri, 13 Apr 2007 22:21:07 +0000 (22:21 +0000)
PC/getpathp.c

index 729d2e4736bbb26bc627a231c54cd716f4c391a9..e62b936f2d360c86b7206bfcb512d2229f22dce3 100644 (file)
@@ -650,7 +650,7 @@ calculate_path(void)
                           start of the path in question - even if this
                           is one character before the start of the buffer
                        */
-                       while (*look != DELIM && look >= module_search_path)
+                       while (look >= module_search_path && *look != DELIM)
                                look--;
                        nchars = lookEnd-look;
                        strncpy(lookBuf, look+1, nchars);