mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +00:00
Issue #9758: When fcntl.ioctl() was called with mutable_flag set to True,
and the passed buffer was exactly 1024 bytes long, the buffer wouldn't be updated back after the system call. Original patch by Brian Brazil.
This commit is contained in:
parent
7f7561ebfc
commit
5e38aae91b
3 changed files with 31 additions and 6 deletions
|
@ -157,7 +157,7 @@ fcntl_ioctl(PyObject *self, PyObject *args)
|
|||
else {
|
||||
ret = ioctl(fd, code, arg);
|
||||
}
|
||||
if (mutate_arg && (len < IOCTL_BUFSZ)) {
|
||||
if (mutate_arg && (len <= IOCTL_BUFSZ)) {
|
||||
memcpy(str, buf, len);
|
||||
}
|
||||
PyBuffer_Release(&pstr); /* No further access to str below this point */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue