diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-08-20 09:25:16 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-09-03 13:15:08 +0200 |
| commit | 4bd70345068ef3fa0ff7ef0724ac5408a10a1609 (patch) | |
| tree | c595491ed08da96f856ba4df12825d99dbe13936 /build_scripts/main.py | |
| parent | 91da4eae80ac4d8daaaeb2ccda5b62f2ef43fd80 (diff) | |
shiboken6: Fix potential memory corruption in enum/flags conversion code
The enum conversion code used a reinterpret_cast to int*
for the C++ values for enums and flags regardless
whether a plain enum or a QFlags<> was used (since it is based
on the same Python type).
For plain enums, this worked sort-of as long as no larger underlying
type was specified.
For flags, this worked by coincidence since QFlags has an int as first
field, but may break as soon as QFlags is changed to accommodate
larger enums.
To fix this, split the converters for flags and enums.
Add a separate flagsConverter field to SbkEnumTypePrivate and
use that for flags.
For plain enums, use a variable of std::underlying_type for the
conversion.
Task-number: PYSIDE-1735
Task-number: QTBUG-111926
Change-Id: Iae2e88da1de7299ab4d461e9802fa81553ed3dbc
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'build_scripts/main.py')
0 files changed, 0 insertions, 0 deletions
