Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
devel:languages:python:backports
python3-pyside6
0001-signature-Fix-pointers-to-signature-bytes-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-signature-Fix-pointers-to-signature-bytes-with-the-h.patch of Package python3-pyside6
From 7911d19e7cd8479c3b3098848ba1627e7de91f29 Mon Sep 17 00:00:00 2001 From: Fabian Vogt <fvogt@suse.de> Date: Mon, 14 Oct 2024 13:09:41 +0200 Subject: [PATCH] signature: Fix pointers to signature bytes with the highest bit set If a pointer to signature bytes has the highest bit set (e.g. 0xf6dd2840 on 32bit), it is interpreted as negative Py_ssize_t value by Py_BuildValue. PyLong_AsSize_t cannot convert this into size_t and returns -1, resulting in an invalid pointer. To avoid this, use PyLong_AsSsize_t and intptr_t instead. --- sources/shiboken6/libshiboken/signature/signature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/shiboken6/libshiboken/signature/signature.cpp b/sources/shiboken6/libshiboken/signature/signature.cpp index e69de193f13b..09d4120bf002 100644 --- a/sources/shiboken6/libshiboken/signature/signature.cpp +++ b/sources/shiboken6/libshiboken/signature/signature.cpp @@ -435,7 +435,7 @@ PyObject *PySide_BuildSignatureProps(PyObject *type_key) if (PyTuple_Check(numkey)) { PyObject *obAddress = PyTuple_GetItem(numkey, 0); PyObject *obSize = PyTuple_GetItem(numkey, 1); - const size_t addr = PyLong_AsSize_t(obAddress); + const intptr_t addr = PyLong_AsSsize_t(obAddress); const Py_ssize_t size = PyLong_AsSsize_t(obSize); const char **cstrings = bytesToStrings(reinterpret_cast<const uint8_t *>(addr), size); if (cstrings == nullptr) -- 2.47.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor