Marc Mutz 1ff68ff3fd QCupsPrintEngine::setProperty(): defend against malformed PPK_CupsOptions values
The QCupsPrintEnginePrivate::closePrintDevice() function expects the
cupsOptions string-list to have an even number of elements, because it
iterates in steps of two and doesn't check the size of the container
while in-between steps.

Print a qWarning() in setProperty() when the option value string-list
has an odd number of elements in it, and append an empty entry to
maintain the expected format for closePrintDevice(). This is the
least-intrusive way to fix the problem, hopefully defining previously
undefined behavior without other user-visible effects.

Amends f70924e9ccc016b979bc74bba156600639184be7, which, however, may
have merely moved the code around.

[ChangeLog][QtPrintSupport][QCupsPrintEngine] Fixed a bug where setting
a value string-list with an odd number of elements as the
PPK_CupsOptions value would read uninitialized data.

Pick-to: 6.5 6.2 5.15
Change-Id: I38ed8de6da00f17fa8fe9138d54db3699943f3b1
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 7ae959e00ae4385215ab8bde0781255f36b8bd59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-19 15:17:39 +00:00
2024-11-07 08:38:49 +01:00
2024-11-07 08:38:49 +01:00
2024-11-07 08:38:49 +01:00
2024-02-02 15:23:02 +00:00
2024-11-07 08:38:49 +01:00
Description
Qt Base (Core, Gui, Widgets, Network, ...)
822 MiB
Languages
C++ 84.3%
HTML 4.9%
C 3.9%
CMake 3.6%
Objective-C++ 2%
Other 0.8%