In Qt 5, a QBitArray could not contain more than INT_MAX bits, because the then-size_type, int, cannot represent more, even if the underlying storage could hold 8x as much, and the serialisation format, using unsigned int, could represent 2x. Therefore, reject old formats with sizes that exceed INT_MAX elements as corrupt. Likewise, the Qt 6 serialisation format unconditionally uses 64-bit sizes, but 32-bit platforms still cannot represent more than numeric_limits<qsizetype>::max() (= INT_MAX) bits in memory. This is a valid stream for 64-bit platforms, though, so ideally, this should be using SizeLimitsExeeded, which, however, is only available from Qt 6.7. So, for now, and until we have SizeLimitsExeeded, mark the stream as corrupt here, too. [ChangeLog][QtCore][QBitArray] Fixed undetected overflows in the deserialisation (opertor>>()) from QDataStream. Pick-to: 6.6 6.5 6.2 5.15 Change-Id: Ib24cf9218c06a3a05185723c77d4313611c2dd40 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 0808beace332631f8100b5700577f10f63e4630c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This directory contains autotests and benchmarks based on Qt Test. In order to run the autotests reliably, you need to configure a desktop to match the test environment that these tests are written for. Linux X11: * The user must be logged in to an active desktop; you can't run the autotests without a valid DISPLAY that allows X11 connections. * The tests are run against a KDE3 or KDE4 desktop. * Window manager uses "click to focus", and not "focus follows mouse". Many tests move the mouse cursor around and expect this to not affect focus and activation. * Disable "click to activate", i.e., when a window is opened, the window manager should automatically activate it (give it input focus) and not wait for the user to click the window.