summaryrefslogtreecommitdiff
path: root/src/if_python3.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-05-12 20:36:14 +0200
committerBram Moolenaar <Bram@vim.org>2013-05-12 20:36:14 +0200
commit8f1723de4735e437b4ced3be95d6582e713c3d7d (patch)
treeb8e71cbe3ac73cc19ceee047a8bdd3d10d37b1a3 /src/if_python3.c
parent3d0c52db9c3e2019bc5fe84debe59c042c3da20b (diff)
downloadvim-git-8f1723de4735e437b4ced3be95d6582e713c3d7d.tar.gz
updated for version 7.3.942v7.3.942
Problem: Python: SEGV in Buffer functions. Solution: Call CheckBuffer() at the right time. (ZyX)
Diffstat (limited to 'src/if_python3.c')
-rw-r--r--src/if_python3.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/if_python3.c b/src/if_python3.c
index 77d7cd3ce..da0867b7e 100644
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -1110,6 +1110,9 @@ BufferSubscript(PyObject *self, PyObject* idx)
{
Py_ssize_t start, stop, step, slicelen;
+ if (CheckBuffer((BufferObject *) self))
+ return NULL;
+
if (PySlice_GetIndicesEx((PyObject *)idx,
(Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count+1,
&start, &stop,
@@ -1139,6 +1142,9 @@ BufferAsSubscript(PyObject *self, PyObject* idx, PyObject* val)
{
Py_ssize_t start, stop, step, slicelen;
+ if (CheckBuffer((BufferObject *) self))
+ return -1;
+
if (PySlice_GetIndicesEx((PyObject *)idx,
(Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count+1,
&start, &stop,