Fix: buffer overflow when creating gpu.types.GPUIndexBuf
authorJacques Lucke <mail@jlucke.com>
Wed, 24 Oct 2018 08:57:16 +0000 (10:57 +0200)
committerJacques Lucke <mail@jlucke.com>
Wed, 24 Oct 2018 08:57:46 +0000 (10:57 +0200)
source/blender/python/gpu/gpu_py_element.c

index 10d6970e9e8ee9703a5c460aa835b4c82665149a..2462c22214633c41500ba04ff0a9c9b4ef74d69c 100644 (file)
@@ -117,7 +117,7 @@ static PyObject *bpygpu_IndexBuf_new(PyTypeObject *UNUSED(type), PyObject *args,
                        GPU_indexbuf_add_generic_vert(&builder, *buf);
                }
 #else
-               memcpy(builder.data, pybuffer.buf, index_len * sizeof(builder.data));
+               memcpy(builder.data, pybuffer.buf, index_len * sizeof(*builder.data));
                builder.index_len = index_len;
 #endif
                PyBuffer_Release(&pybuffer);