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

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

index 54232a130082f08f823b8276bf69ba07bf424d5d..db70909982fa3eb2a9f64ce06543cd45f9d0c41a 100644 (file)
@@ -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;