diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-07 16:30:09 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-07 16:30:09 (GMT) |
commit | 5e38aae91bcc1ae0560debb9866df17e7da20ab1 (patch) | |
tree | e2f7c76e4df9baa236dfc2eeb7025d14f73133d4 /Modules | |
parent | 7f7561ebfc10089d7ee651487835d6229d5a97e2 (diff) | |
download | cpython-5e38aae91bcc1ae0560debb9866df17e7da20ab1.zip cpython-5e38aae91bcc1ae0560debb9866df17e7da20ab1.tar.gz cpython-5e38aae91bcc1ae0560debb9866df17e7da20ab1.tar.bz2 |
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.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/fcntlmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c index a7cdccb..bfc5985 100644 --- a/Modules/fcntlmodule.c +++ b/Modules/fcntlmodule.c @@ -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 */ |