Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
gh-144206: Improve error messages for buffer overflow in fcntl.fcntl() and fcntl.ioctl()#144273
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
gh-144206: Improve error messages for buffer overflow in fcntl.fcntl() and fcntl.ioctl()#144273
Conversation
…fcntl() and fcntl.ioctl()
Misc/NEWS.d/next/Library/2026-01-27-14-23-10.gh-issue-144206.l0un4U.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Victor Stinner <vstinner@python.org>
| PyErr_SetString(PyExc_SystemError, "buffer overflow"); | ||
| PyErr_SetString(PyExc_SystemError, | ||
| "Possible stack corruption in fcntl() due to " | ||
| "buffer overflow. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Why do you use a different message for the memcmp() case? It's not a "Memory corruption" here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It depends whether the buffer was on the stack or in the heap memory (preallocated bytes object).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It depends whether the buffer was on the stack or in the heap memory (preallocated bytes object).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Oh ok, it makes sense. I didn't notice that one code path allocated memory on the stack.
vstinner left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
Uh oh!
There was an error while loading.Please reload this page.