classification
Title: os.chdir(), os.getcwd() may crash on Windows in presence of races
Type: crash Stage: patch review
Components: Extension Modules, Windows Versions: Python 3.7, Python 3.6, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: izbyshev, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Priority: normal Keywords: patch

Created on 2018-02-22 01:00 by izbyshev, last changed 2018-02-22 02:23 by izbyshev.

Pull Requests
URL Status Linked Edit
PR 5802 open izbyshev, 2018-02-22 01:04
Messages (2)
msg312524 - (view) Author: Alexey Izbyshev (izbyshev) * (Python triager) Date: 2018-02-22 01:00
win32_wchdir() retries GetCurrentDirectory() with a larger buffer if necessary, but doesn't check whether the new buffer is large enough. Another thread could change the current directory in meanwhile, so the buffer could turn out to be still not large enough, left in an uninitialized state and passed to SetEnvironmentVariable() afterwards.
msg312527 - (view) Author: Alexey Izbyshev (izbyshev) * (Python triager) Date: 2018-02-22 02:23
The same issue applies to os.getcwd().
History
Date User Action Args
2018-02-22 02:23:26izbyshevsetmessages: + msg312527
title: os.chdir() may crash on Windows in presence of races -> os.chdir(), os.getcwd() may crash on Windows in presence of races
2018-02-22 01:04:01izbyshevsetkeywords: + patch
stage: patch review
pull_requests: + pull_request5580
2018-02-22 01:00:15izbyshevcreate