Patches for getpath.c in Python 2.7 and 3.2a3:
2.7 chunk#2: copy_absolute() would use uninitialized data if getcwd()
failed. The fix is equivalent to what 3.2a3 does.
3.2a3 chunk#2: search_for_exec_prefix() did 'unsigned value >= 0' on the
PyUnicode_AsWideChar() result. (The fix just renames n to k of signed
type, and moves the variables. An outer uninitialized 'size_t n' is in
scope, so renaming the inner n to k leaves 'n=fread()' still a size_t.)
Chunk #1, both versions: Fix an unlikely 'n+k' wraparound bug while I'm
at it. The code has just checked that MAXPATHLEN-n will not wrap. |