From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 29 Jan 2024 10:09:51 +0000 (+0100) Subject: [3.12] gh-114685: Fix incorrect use of PyBUF_READ in import.c (GH-114686) (GH-114700) X-Git-Tag: v3.12.2~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2a1d2c83256e6445793ec8b79363e4ac4494db78;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-114685: Fix incorrect use of PyBUF_READ in import.c (GH-114686) (GH-114700) (cherry picked from commit 1ac1b2f9536a581f1656f0ac9330a7382420cda1) Co-authored-by: Nikita Sobolev --- diff --git a/Python/import.c b/Python/import.c index 54232a130082..db70909982fa 100644 --- a/Python/import.c +++ b/Python/import.c @@ -3570,7 +3570,7 @@ _imp_get_frozen_object_impl(PyObject *module, PyObject *name, struct frozen_info info = {0}; Py_buffer buf = {0}; if (PyObject_CheckBuffer(dataobj)) { - if (PyObject_GetBuffer(dataobj, &buf, PyBUF_READ) != 0) { + if (PyObject_GetBuffer(dataobj, &buf, PyBUF_SIMPLE) != 0) { return NULL; } info.data = (const char *)buf.buf;