mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Reject float as uid or gid.
A regression was introduced in the commit for issue #4591.
This commit is contained in:
commit
a7b5e82ff0
1 changed files with 14 additions and 2 deletions
|
@ -406,7 +406,13 @@ int
|
|||
_Py_Uid_Converter(PyObject *obj, void *p)
|
||||
{
|
||||
int overflow;
|
||||
long result = PyLong_AsLongAndOverflow(obj, &overflow);
|
||||
long result;
|
||||
if (PyFloat_Check(obj)) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"integer argument expected, got float");
|
||||
return 0;
|
||||
}
|
||||
result = PyLong_AsLongAndOverflow(obj, &overflow);
|
||||
if (overflow < 0)
|
||||
goto OverflowDown;
|
||||
if (!overflow && result == -1) {
|
||||
|
@ -454,7 +460,13 @@ int
|
|||
_Py_Gid_Converter(PyObject *obj, void *p)
|
||||
{
|
||||
int overflow;
|
||||
long result = PyLong_AsLongAndOverflow(obj, &overflow);
|
||||
long result;
|
||||
if (PyFloat_Check(obj)) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"integer argument expected, got float");
|
||||
return 0;
|
||||
}
|
||||
result = PyLong_AsLongAndOverflow(obj, &overflow);
|
||||
if (overflow < 0)
|
||||
goto OverflowDown;
|
||||
if (!overflow && result == -1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue