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

Check PID range before any cext call #2266

Merged
merged 9 commits into from
Jun 8, 2023

Conversation

XuehaiPan
Copy link
Contributor

@XuehaiPan XuehaiPan commented Jun 6, 2023

Summary

Description

Add a new C function that checks if Python int can be parsed into PID type. It raises OverflowError if the value out of range. This function is exposed to the Python side and will be called only once in Process._init.

Fixes #2264

Signed-off-by: Xuehai Pan <[email protected]>
psutil/__init__.py Outdated Show resolved Hide resolved
psutil/_psutil_aix.c Outdated Show resolved Hide resolved
psutil/tests/test_misc.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Windows] Got "OverflowError: Python int too large to convert to C long" on large non-exist PIDs
2 participants