updated for version 7.3.942
Problem: Python: SEGV in Buffer functions.
Solution: Call CheckBuffer() at the right time. (ZyX)
diff --git a/src/if_python.c b/src/if_python.c
index 8e3621c..dda65af 100644
--- a/src/if_python.c
+++ b/src/if_python.c
@@ -1073,17 +1073,13 @@
static PyInt
BufferAssItem(PyObject *self, PyInt n, PyObject *val)
{
- return RBAsItem((BufferObject *)(self), n, val, 1,
- (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count,
- NULL);
+ return RBAsItem((BufferObject *)(self), n, val, 1, -1, NULL);
}
static PyInt
BufferAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val)
{
- return RBAsSlice((BufferObject *)(self), lo, hi, val, 1,
- (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count,
- NULL);
+ return RBAsSlice((BufferObject *)(self), lo, hi, val, 1, -1, NULL);
}
static PySequenceMethods RangeAsSeq = {