Mercurial > vim
diff src/if_python3.c @ 4387:358c10968c7f v7.3.942
updated for version 7.3.942
Problem: Python: SEGV in Buffer functions.
Solution: Call CheckBuffer() at the right time. (ZyX)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 12 May 2013 20:36:14 +0200 |
parents | 8ec7323f417d |
children | 736b8e18a3bc |
line wrap: on
line diff
--- a/src/if_python3.c +++ b/src/if_python3.c @@ -1110,6 +1110,9 @@ BufferSubscript(PyObject *self, PyObject { 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, PyObje { 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,