mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Issue #29044: Fix a use-after-free in string '%c' formatter.
This commit is contained in:
parent
c67983b829
commit
ea1cf87030
1 changed files with 4 additions and 3 deletions
|
@ -14213,11 +14213,12 @@ formatchar(PyObject *v)
|
||||||
if (iobj == NULL) {
|
if (iobj == NULL) {
|
||||||
goto onError;
|
goto onError;
|
||||||
}
|
}
|
||||||
v = iobj;
|
x = PyLong_AsLong(iobj);
|
||||||
Py_DECREF(iobj);
|
Py_DECREF(iobj);
|
||||||
}
|
}
|
||||||
/* Integer input truncated to a character */
|
else {
|
||||||
x = PyLong_AsLong(v);
|
x = PyLong_AsLong(v);
|
||||||
|
}
|
||||||
if (x == -1 && PyErr_Occurred())
|
if (x == -1 && PyErr_Occurred())
|
||||||
goto onError;
|
goto onError;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue