Merged revisions 84589 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84589 | antoine.pitrou | 2010-09-07 18:30:09 +0200 (mar., 07 sept. 2010) | 5 lines

  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:
Antoine Pitrou 2010-09-07 16:32:28 +00:00
parent 15db1443ae
commit 334e0dde1d
3 changed files with 31 additions and 6 deletions

View file

@ -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 */