summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-19 10:26:26 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-19 10:26:26 (GMT)
commit441d30fac7f4037e4a79e4ada873de3b6f6e5a26 (patch)
treea406cb41f1b78476445786f408b95b1cd0bdb7a6 /Include
parentff12fae80e15ad29ae2557d23e70f6ff9365b31f (diff)
downloadcpython-441d30fac7f4037e4a79e4ada873de3b6f6e5a26.zip
cpython-441d30fac7f4037e4a79e4ada873de3b6f6e5a26.tar.gz
cpython-441d30fac7f4037e4a79e4ada873de3b6f6e5a26.tar.bz2
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 c09565a..5f8b178 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