summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-02-16 18:52:17 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-02-16 18:52:17 (GMT)
commit26861b0b29fdf64fba8cd120183408495f2c80e2 (patch)
tree68aa9e4560327db352dcbda56bf3ea0325bde0f7 /Python
parent4d0d9829851915e97ae392dd803976be6c95c8d1 (diff)
downloadcpython-26861b0b29fdf64fba8cd120183408495f2c80e2.zip
cpython-26861b0b29fdf64fba8cd120183408495f2c80e2.tar.gz
cpython-26861b0b29fdf64fba8cd120183408495f2c80e2.tar.bz2
Issue #23450: Fixed possible integer overflows.
Diffstat (limited to 'Python')
-rw-r--r--Python/codecs.c2
-rw-r--r--Python/marshal.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/Python/codecs.c b/Python/codecs.c
index a558859..64fc3d6 100644
--- a/Python/codecs.c
+++ b/Python/codecs.c
@@ -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;
diff --git a/Python/marshal.c b/Python/marshal.c
index c1ce2fe..d26a997 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -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);