patch 8.2.1146: not enough testing for Python
Problem: Not enough testing for Python.
Solution: Add more tests. Fix uncovered problems. (Yegappan Lakshmanan,
closes #6392)
diff --git a/src/if_python3.c b/src/if_python3.c
index ecca163..d540226 100644
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -1256,6 +1256,10 @@
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);