summaryrefslogtreecommitdiff
path: root/Include
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-19 12:41:45 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-19 12:41:45 +0200
commit9101e23ff6006d9ede7d46e8c9e7d39e23c2a3c3 (patch)
treec61aebdba4dddc8f10c9460ca33b0fa3f2e1495d /Include
parentbd8f29028eab752e8e5c73703218a701028c1a9a (diff)
parent441d30fac7f4037e4a79e4ada873de3b6f6e5a26 (diff)
downloadcpython-git-9101e23ff6006d9ede7d46e8c9e7d39e23c2a3c3.tar.gz
Issue #15989: Fix several occurrences of integer overflow
when result of PyLong_AsLong() narrowed to int without checks. This is a backport of changesets 13e2e44db99d and 525407d89277.
Diffstat (limited to 'Include')
-rw-r--r--Include/longobject.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Include/longobject.h b/Include/longobject.h
index d741f1b4c0..cd0cf30814 100644
--- a/Include/longobject.h
+++ b/Include/longobject.h
@@ -26,6 +26,9 @@ PyAPI_FUNC(Py_ssize_t) PyLong_AsSsize_t(PyObject *);
PyAPI_FUNC(size_t) PyLong_AsSize_t(PyObject *);
PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *);
PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(int) _PyLong_AsInt(PyObject *);
+#endif
PyAPI_FUNC(PyObject *) PyLong_GetInfo(void);
/* It may be useful in the future. I've added it in the PyInt -> PyLong