summaryrefslogtreecommitdiff
path: root/Include/longobject.h
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-19 12:26:26 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-19 12:26:26 +0200
commit441d30fac7f4037e4a79e4ada873de3b6f6e5a26 (patch)
treea406cb41f1b78476445786f408b95b1cd0bdb7a6 /Include/longobject.h
parentff12fae80e15ad29ae2557d23e70f6ff9365b31f (diff)
downloadcpython-git-441d30fac7f4037e4a79e4ada873de3b6f6e5a26.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/longobject.h')
-rw-r--r--Include/longobject.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Include/longobject.h b/Include/longobject.h
index c09565a117..5f8b178dd9 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