cpython
cpython copied to clipboard
gh-142783: Fix use-after-free vulnerability in zoneinfo module
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.
- Issue: gh-142783