mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #23450: Fixed possible integer overflows.
This commit is contained in:
parent
4d0d982985
commit
26861b0b29
8 changed files with 64 additions and 50 deletions
|
@ -1006,7 +1006,7 @@ PyObject *PyCodec_NameReplaceErrors(PyObject *exc)
|
|||
c = PyUnicode_READ_CHAR(object, i);
|
||||
if (ucnhash_CAPI &&
|
||||
ucnhash_CAPI->getname(NULL, c, buffer, sizeof(buffer), 1)) {
|
||||
replsize = 1+1+1+strlen(buffer)+1;
|
||||
replsize = 1+1+1+(int)strlen(buffer)+1;
|
||||
}
|
||||
else if (c >= 0x10000) {
|
||||
replsize = 1+1+8;
|
||||
|
|
|
@ -279,7 +279,7 @@ w_ref(PyObject *v, char *flag, WFILE *p)
|
|||
PyErr_SetString(PyExc_ValueError, "too many objects");
|
||||
goto err;
|
||||
}
|
||||
w = s;
|
||||
w = (int)s;
|
||||
Py_INCREF(v);
|
||||
if (_Py_HASHTABLE_SET(p->hashtable, v, w) < 0) {
|
||||
Py_DECREF(v);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue