Potential integer overflow in instrumentation.c
Open
Nobody has claimed this yet.
interpreter-core
type-bug
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
The arithmetic expression to * (int)sizeof(_Py_CODEUNIT) can overflow if the number of instructions in a function exceeds MAX_INT / 2, as to represents the instruction offset and sizeof(_Py_CODEUNIT) is 2.
https://github.com/python/cpython/blob/4b44b3409ac026e7f13054a3daa18ab7ee14d85c/Python/instrumentation.c#L1239
Linked PRs
- gh-135179
- gh-135202
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Python/instrumentation.c around line 1239 and inspect the arithmetic expression identified in the issue. Review linked PRs gh-135179 and gh-135202 first; done means the potential overflow is addressed and the relevant CPython checks pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100