forked from aniani/vim
updated for version 7.3.942
Problem: Python: SEGV in Buffer functions. Solution: Call CheckBuffer() at the right time. (ZyX)
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user