diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-07-06 21:03:06 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-07-06 21:03:06 +0200 |
commit | ab5894638413748fcedfe28691e6c27893924520 (patch) | |
tree | 45318c835f879c4ff5f235f7774c37f5a6a9d359 /src/if_python3.c | |
parent | 0ad3e894d75236915e67dfbbcc821b6bb3c05d91 (diff) | |
download | vim-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.c | 4 |
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); |