]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-114685: Fix incorrect use of PyBUF_READ in import.c (GH-114686) (GH-114701)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 29 Jan 2024 10:03:14 +0000 (11:03 +0100)
committerGitHub <noreply@github.com>
Mon, 29 Jan 2024 10:03:14 +0000 (10:03 +0000)
(cherry picked from commit 1ac1b2f9536a581f1656f0ac9330a7382420cda1)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Python/import.c

index 39144d302193ac8bee16f0e95c7fd6820a00cd0c..c4e2145a47c4d2d1bd55e303ce7697646bd79f5d 100644 (file)
@@ -2194,7 +2194,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;