summaryrefslogtreecommitdiff
path: root/src/if_python3.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-07-06 21:03:06 +0200
committerBram Moolenaar <Bram@vim.org>2020-07-06 21:03:06 +0200
commitab5894638413748fcedfe28691e6c27893924520 (patch)
tree45318c835f879c4ff5f235f7774c37f5a6a9d359 /src/if_python3.c
parent0ad3e894d75236915e67dfbbcc821b6bb3c05d91 (diff)
downloadvim-git-ab5894638413748fcedfe28691e6c27893924520.tar.gz
patch 8.2.1146: not enough testing for Pythonv8.2.1146
Problem: Not enough testing for Python. Solution: Add more tests. Fix uncovered problems. (Yegappan Lakshmanan, closes #6392)
Diffstat (limited to 'src/if_python3.c')
-rw-r--r--src/if_python3.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/if_python3.c b/src/if_python3.c
index ecca163b0..d540226b3 100644
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -1256,6 +1256,10 @@ BufferAsSubscript(PyObject *self, PyObject* idx, PyObject* val)
if (PyLong_Check(idx))
{
long n = PyLong_AsLong(idx);
+
+ if (CheckBuffer((BufferObject *) self))
+ return -1;
+
return RBAsItem((BufferObject *)(self), n, val, 1,
(Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count,
NULL);