diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2009-12-23 09:46:53 +0000 |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2009-12-23 09:46:53 +0000 |
commit | 21c134d0e30b3bcb8733bdd33b9aea10305c2025 (patch) | |
tree | 76312f72a8a9211fbf656c531dfe801feb66c81c /Modules/posixmodule.c | |
parent | 25339af98d2ce0eac2974ec2ae4edf8142eaccff (diff) | |
download | cpython-git-21c134d0e30b3bcb8733bdd33b9aea10305c2025.tar.gz |
Merged revisions 77007 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77007 | gregory.p.smith | 2009-12-23 01:31:11 -0800 (Wed, 23 Dec 2009) | 3 lines
Fix possible integer overflow in lchown and fchown functions. For issue1747858.
........
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index ebdbc8d55b..616722f55c 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1923,9 +1923,10 @@ fd to the numeric uid and gid."); static PyObject * posix_fchown(PyObject *self, PyObject *args) { - int fd, uid, gid; + int fd; + long uid, gid; int res; - if (!PyArg_ParseTuple(args, "iii:chown", &fd, &uid, &gid)) + if (!PyArg_ParseTuple(args, "ill:chown", &fd, &uid, &gid)) return NULL; Py_BEGIN_ALLOW_THREADS res = fchown(fd, (uid_t) uid, (gid_t) gid); @@ -1946,9 +1947,9 @@ static PyObject * posix_lchown(PyObject *self, PyObject *args) { char *path = NULL; - int uid, gid; + long uid, gid; int res; - if (!PyArg_ParseTuple(args, "etii:lchown", + if (!PyArg_ParseTuple(args, "etll:lchown", Py_FileSystemDefaultEncoding, &path, &uid, &gid)) return NULL; |