summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-07 16:30:09 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-07 16:30:09 (GMT)
commit5e38aae91bcc1ae0560debb9866df17e7da20ab1 (patch)
treee2f7c76e4df9baa236dfc2eeb7025d14f73133d4 /Modules
parent7f7561ebfc10089d7ee651487835d6229d5a97e2 (diff)
downloadcpython-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.c2
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 */