-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
string parameter to ioctl not null terminated, includes fix #42917
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
Comments
I ran across this problem in Python 2.3.3 and see it is When running the test_pty.py test case, I would get There was garbage on the end of the string when it I tracked the problem back to fcntl_ioctl() in I checked the source for 2.4.2 and noticed the same |
Logged In: YES Thomas, could this have caused the flakiness that you just |
Logged In: YES One problem with ioctl() is that the required length of the I don't think the patch makes ioctl "safe", and I'm not sure
if (mutate_arg && (len < sizeof buf)) { ought to test (len <= sizeof buf) to match the test earlier; if (mutate_arg && arg == buf) {
|
Logged In: YES I've practically never used python. I just found I don't follow the remark about "making ioctl I also never said anything about the interpreter Are you sure you responded to the right bug Anyways... This problem should be reduced to a classic This problem I encountered is either a bug in If a python code isn't expected to put a literal As for null-terminating other raw data, I don't The problem I ran across is limited to just As for the buffer vs. documentation, the Since python strings serve dual roles of being |
Logged In: YES Sorry for the confusion. I was in part responding to an The difference in marshalling Python data to C data for I tend to agree with your conclusion that we should extend |
Logged In: YES Seeing as some of this is my code... Guido, the ioctl docstring *does* mention mutate_arg. I agree that the It certainly never occurred to me that you might need/want to pass a NULL I don't think this is a priority 9 report. |
Logged In: YES I didn't write new code that causes this problem by calling I reworked the patch as discussed below and retested it. I've attached it. I hae no idea of Python coding (This was weird. SF rejected the text above when I |
Logged In: YES mwh: Sorry about the docstring gripe -- I read the fcntl() I think the priority was set to 9 by Neal to get Thomas' gbarnes: We'll decide this one at PyCon. |
Logged In: YES Huh, I never even saw this patch, in spite of the high We didn't discuss it at PyCon (at least, I wasn't party to |
Logged In: YES Hrm. After giving this some thought, perhaps we should do memcpy(buf, str, len+1) instead of memcpy(buf, str, len)
buf[len] = '\0' (And do this in the writable-buffer case as well, when we |
Logged In: YES Checked this in before 2.5 alpha2, after more contemplation. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: