gh-142783: Fix use-after-free vulnerability in zoneinfo module#142786
Closed
fatelei wants to merge 48 commits intopython:mainfrom
Closed
gh-142783: Fix use-after-free vulnerability in zoneinfo module#142786fatelei wants to merge 48 commits intopython:mainfrom
fatelei wants to merge 48 commits intopython:mainfrom
Conversation
….zoneinfo'; 'tzdata' is not a package
…ythonGH-136070) Signed-off-by: Manjusaka <me@manjusaka.me>
…onGH-142667) The variable was previously used, but became unused after 133138a. Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
…ction.getresponse` (python#142339)
…_O` (pythonGH-142695) Co-authored-by: Ken Jin <kenjin4096@gmail.com>
…#127931) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
… `__version__` attributes (python#139997)
…ython#142676) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…-142735) We need to use release/acquire ordering for the 'mask' member of the set structure. Without this, `set_lookkey_threadsafe()` could be looking at the old value of `table` but the new value of `mask`.
…thon#141162) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Brett Cannon <brett@python.org>
…n#142243) When a `str` is encoded in `bytearray.__init__` the encoder tends to create a new unique bytes object. Rather than allocate new memory and copy the bytes use the already created bytes object as bytearray backing. The bigger the `str` the bigger the saving. Mean +- std dev: [main_encoding] 497 us +- 9 us -> [encoding] 14.2 us +- 0.3 us: 34.97x faster ```python import pyperf runner = pyperf.Runner() runner.timeit( name="encode", setup="a = 'a' * 1_000_000", stmt="bytearray(a, encoding='utf8')") ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When _weak_cache is a descriptor that creates a new object each time it's accessed, get_weak_cache() incorrectly assumed it could return a borrowed reference and immediately decremented the reference count. This caused the newly created cache object to be freed too early, leading to use-after-free when the cache object was subsequently accessed.
zoneinfo.get_weak_cachevia weak DECREF assumption #142783