diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2008-08-12 14:49:50 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2008-08-12 14:49:50 (GMT) |
commit | f91d46a17d85da323895950852093117bc21f860 (patch) | |
tree | c6a3e68cf22a6a102f9c1dc780438f0307b6588f /Objects/stringobject.c | |
parent | aa8efbf08469c3667ed22362c0e10b83ae124c0b (diff) | |
download | cpython-f91d46a17d85da323895950852093117bc21f860.zip cpython-f91d46a17d85da323895950852093117bc21f860.tar.gz cpython-f91d46a17d85da323895950852093117bc21f860.tar.bz2 |
Issue #3139: Make buffer-interface thread-safe wrt. PyArg_ParseTuple,
by denying s# to parse objects that have a releasebuffer procedure,
and introducing s*.
More module might need to get converted to use s*.
Diffstat (limited to 'Objects/stringobject.c')
-rw-r--r-- | Objects/stringobject.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 6d53a09..5bf4add 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -1328,7 +1328,8 @@ string_buffer_getcharbuf(PyStringObject *self, Py_ssize_t index, const char **pt static int string_buffer_getbuffer(PyStringObject *self, Py_buffer *view, int flags) { - return PyBuffer_FillInfo(view, (void *)self->ob_sval, Py_SIZE(self), + return PyBuffer_FillInfo(view, (PyObject*)self, + (void *)self->ob_sval, Py_SIZE(self), 1, flags); } @@ -1359,7 +1360,7 @@ static PyBufferProcs string_as_buffer = { }; - + #define LEFTSTRIP 0 #define RIGHTSTRIP 1 #define BOTHSTRIP 2 @@ -3996,7 +3997,7 @@ PyDoc_STRVAR(p_format__doc__, \n\ "); - + static PyMethodDef string_methods[] = { /* Counterparts of the obsolete stropmodule functions; except |