1. Armin Rigo
  2. cpython-withatomic

Commits

Kristján Valur Jónsson  committed ed82023

Fix potential crash in path manipulation on windows

  • Participants
  • Parent commits 82f2791
  • Branches 2.5

Comments (0)

Files changed (1)

File PC/getpathp.c

View file
  • Ignore whitespace
 			   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);