summaryrefslogtreecommitdiff
path: root/Modules/fcntlmodule.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-07 16:30:09 +0000
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-07 16:30:09 +0000
commit5e38aae91bcc1ae0560debb9866df17e7da20ab1 (patch)
treee2f7c76e4df9baa236dfc2eeb7025d14f73133d4 /Modules/fcntlmodule.c
parent7f7561ebfc10089d7ee651487835d6229d5a97e2 (diff)
downloadcpython-git-5e38aae91bcc1ae0560debb9866df17e7da20ab1.tar.gz
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/fcntlmodule.c')
-rw-r--r--Modules/fcntlmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c
index a7cdccb8a7..bfc59855dd 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 */