Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-33001: Minimal fix to prevent buffer overrun in os.symlink #5989

Merged
merged 3 commits into from Mar 5, 2018

Conversation

@zooba
Copy link
Member

zooba commented Mar 5, 2018

@zooba zooba changed the title Minimal fix to prevent buffer overrun in os.symlink bpo-33001: Minimal fix to prevent buffer overrun in os.symlink Mar 5, 2018
@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Mar 5, 2018

GH-5990 is a backport of this pull request to the 3.6 branch.

@zooba zooba self-assigned this Mar 5, 2018
# overflow dest with relative src
(segment, path),
# overflow dest when appending '\\' for join
(segment, path[:261]),

This comment has been minimized.

Copy link
@izbyshev

izbyshev Mar 5, 2018

Contributor

FWIW, this won't overflow when appending \\ because:

  • len(path[:261]) > MAX_PATH - 1, so it'll overflow in the very beginning of _check_dirW
  • even if len was equal to MAX_PATH - 1, _dirnameW would be applied first, making it shorter.
@zooba zooba merged commit 6921e73 into python:master Mar 5, 2018
4 checks passed
4 checks passed
bedevere/issue-number Issue number 33001 found
Details
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@miss-islington

This comment has been minimized.

Copy link

miss-islington commented Mar 5, 2018

Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒🤖

zooba added a commit that referenced this pull request Mar 5, 2018
)
@zooba zooba deleted the zooba:symlink-bug branch Mar 5, 2018
@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Mar 5, 2018

GH-5996 is a backport of this pull request to the 3.7 branch.

miss-islington added a commit to miss-islington/cpython that referenced this pull request Mar 5, 2018
(cherry picked from commit 6921e73)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
miss-islington added a commit that referenced this pull request Mar 5, 2018
(cherry picked from commit 6921e73)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
jo2y added a commit to jo2y/cpython that referenced this pull request Mar 23, 2018
larryhastings added a commit that referenced this pull request May 14, 2018
* bpo-33001: Minimal fix to prevent buffer overrun in os.symlink

* Skips test to avoid crashing during the test suite

* Remove invalid test
larryhastings added a commit that referenced this pull request May 14, 2018
* bpo-33001: Minimal fix to prevent buffer overrun in os.symlink

* Remove invalid test
yahya-abou-imran added a commit to yahya-abou-imran/cpython that referenced this pull request Nov 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.