Skip to content

gh-127681: Fix overflow vulnerabilities in PyMem_Malloc calls#153489

Open
pranavchoudhary-tech wants to merge 3 commits into
python:mainfrom
pranavchoudhary-tech:fix/overflows-127681
Open

gh-127681: Fix overflow vulnerabilities in PyMem_Malloc calls#153489
pranavchoudhary-tech wants to merge 3 commits into
python:mainfrom
pranavchoudhary-tech:fix/overflows-127681

Conversation

@pranavchoudhary-tech

@pranavchoudhary-tech pranavchoudhary-tech commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Fixes #127681 by systematically replacing PyMem_Malloc calls involving arithmetic with PyMem_New or adding explicit PY_SSIZE_T_MAX checks, as well as adding safety notes to appropriately constrained variables.

@pranavchoudhary-tech pranavchoudhary-tech changed the title Fix overflow vulnerabilities in PyMem_Malloc calls gh-127681: Fix overflow vulnerabilities in PyMem_Malloc calls Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add overflow checks before calling memory allocators

1 participant