summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QStandardPaths/Unix: improve the XDG_RUNTIME_DIR creation/detectionThiago Macieira2020-12-071-42/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, use QT_MKDIR instead of QFileSystemEngine::createDirectory(), as the latter can't create a directory with the right permissions. That would allow an attacker to briefly obtain access to the runtime dir between the mkdir() and chmod() system calls. Second, make sure that if the target already exists that it is a directory and not a symlink (even to a directory). If it is a symlink that belongs to another user, it can be changed to point to another place, which we won't like. And as a bonus, we're printing more information to the user in case something went wrong. Sample outputs: QStandardPaths: runtime directory '/root' is not owned by UID 1000, but a directory permissions 0700 owned by UID 0 GID 0 QStandardPaths: runtime directory '/dev/null' is not a directory, but a character device, socket or FIFO permissions 0666 owned by UID 0 GID 0 QStandardPaths: runtime directory '/etc/passwd' is not a directory, but a regular file permissions 0644 owned by UID 0 GID 0 QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-tjmaciei' QStandardPaths: runtime directory '/tmp/runtime-tjmaciei' is not a directory, but a symbolic link to a directory permissions 0755 owned by UID 1000 GID 100 Change-Id: Iea47e0f8fc8b40378df7fffd16248b663794c613 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit ad5a65b6a2bfca1658634e380559d14ea1e904a4 plus a lot of others) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: Kill calls to deprecated func in API 29Piotr Mikolajczyk2020-12-071-56/+8
| | | | | | | | | | | | | | | | | Since API 29 functions: - getExternalStoragePublicDirectory - getExternalStorageDirectory are deprecated and no longer return directly accessible path. This patch replaces calls to those with suggested call to Context.getExternalFilesDir(String) Task-number: QTBUG-87803 Change-Id: I36bc5d5b72a80017996445af0d577aacf5e112d3 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit e1440dd7bc1a5da9a536f88b9733d04ec8fa6e61) Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fix QImage::setPixelColor on RGBA64_PremultipliedAllan Sandfeld Jensen2020-12-041-4/+1
| | | | | | | | | QColors were not premultiplied before being set. Change-Id: Id3765b6932a72374ddfd788fae4bb628a4edf0b7 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 0c19e3f703a7c3fd59e6db8a9d4ac7091674b552) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* widgets: Avoid crash in QScrollerFabian Vogt2020-12-041-1/+2
| | | | | | | | | | | | | | | | | Quoting c6a32751 in okular[1]: QScrollerPrivate::setDpiFromWidget() before Qt 5.14 crashes when the target widget does not intersect a physical screen, because QDesktopWidget returns screen index `-1` in this case, which leads to an out-of-range read from QApplication::screens(), which leads to a segfault when reading from an invalid QScreen* pointer. [1] https://invent.kde.org/graphics/okular/-/commit/c6a32751 Fixes: QTBUG-88288 Change-Id: Ia572bf0207aa6d8ca2a209d22daa36b962e6de7d Reviewed-by: Fabian Vogt <fabian@ritter-vogt.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Cosmetic stroker: avoid overflows for non-finite coordinatesEirik Aavitsland2020-12-011-0/+2
| | | | | | | | | | | | | | | int overflows are usually avoided by clipping the qreal coordinates to the device rect. However the clip function did not handle inf or nan coordinates, so such values would be passed on. Fix by treating any line with such coordinates a fully clipped away, i.e. rejecting it, since it cannot be meaningfully stroked anyway. Fixes oss-fuzz issue 25330. Change-Id: I4646172fc7a7e0a3a5f5cf03ce10ff0fb56b0d03 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Robert Loehning <robert.loehning@qt.io> (cherry picked from commit cfad8a352ae151dd413af1bdea08e25d56309963) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Containers: call constructors even for primitive typesGiuseppe D'Angelo2020-12-013-25/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Trivial types are automatically classified as Q_PRIMITIVE_TYPE, but it doesn't mean that they can be initialized with memset(0) (notably, pointers to data members on Itanium ABIs are initialized with -1, not 0). Drop that kind of optimization, and always value-initialize objects in containers. Fix the documentation to match as well. This is a rework of f6f68409a40beaa5f034c411dd7e296c7828d8fd and 82b13880b994ff9b87710e0729e32035ab3b63a4 in Qt 6. [ChangeLog][QtCore][QTypeInfo] The semantics of Q_PRIMITIVE_TYPE have been slightly changed. Qt now value-initializes types marked as primitive (which, by default, include trivial types) instead of simply using memset(0), which is wrong in some corner cases. Change-Id: Ib61396be883424e2f03a9f3bbce1eaddce6aa731 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 76671a57b5418ec98fe2c94a963728ac3306dc82) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMacStyle - remove vertical adjustment for inactive tabTimur Pocheptsov2020-12-011-2/+0
| | | | | | | | | | While it worked as expected with beta, with final release this thing looks wrong again, especially in the dark mode. Change-Id: I6857344de897e0f39d9d8e66431635dbe2f4d077 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit abee4cdd5925a8513f51784754fca8fa35031732) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Let QXcbConnection::getTimestamp properly exit when X server quitsSheng Mao2020-12-011-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | QXcbConnection::getTimestamp uses dummy events to get timestamp from X server. However, in some cases, X server shuts down while client tries to get timestamp. In this case, QXcbConnection::getTimestamp keeps getting null event and thus falls into indefinite loop. This fix checks if xcb connection is still valid and use a special xcb_timestamp_t value, CurrentTime (0L), as returned value. CurrentTime should not be generated by X server and if getTimestamp returns this value, it means an "exception" case is triggered. This fix is introduced because in kwin_x11 (KDE project), X server can exit on logout. kwin_x11 should handle disconnection from X server. But the indefinite loop prevents kwin_x11 to process disconnection event and therefore kwin_x11 cannot quit properly. Fixes: QTBUG-88435 Change-Id: Iaf7ef3f8a35fa8389d22a608e3c49041bf90e1b9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit dbd1c8b047700bb6d0adae848d6cbb89fa2fcfff) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Limit pen width to maximal 32767Allan Sandfeld Jensen2020-11-271-4/+7
| | | | | | | | | Fixes oss-fuzz 25195 Change-Id: I8c68cf71f6702d8b1b1a2ddda3284c14f02d7972 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit c7a335817e909951bfd142018f855645b4a46168) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Limit value in setFontWeightFromValue()Robert Loehning2020-11-241-1/+1
| | | | | | | | | | | QFont::setWeight() just accepts values between 0 and 900 anyway. Fixes: oss-fuzz-24986 Change-Id: Ic65139a7821be3a12c65444d010736f03c8b74f5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit ccc205bf38ffbe60180a069939a4aff01e7734e5) Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QStackedLayout: fix a memory leakGiuseppe D'Angelo2020-11-231-1/+3
| | | | | | | | | A layout takes ownership of the QLayoutItem passed to addItem. Change-Id: Iea3c64453f3cbf4f1b5660e505c1a35dca537833 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 1fcc882d7ca564f17e49b8d51adc43eb5b97c57b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid integer overflow and division by zeroAllan Sandfeld Jensen2020-11-231-3/+3
| | | | | | | | | | | | Restrain patterns to sensible lengths and values. [ChangeLog][QCosmeticStroker] Pen patterns are restrained to a maximum length and values of 1024, fixing oss-fuzz issue 25310. Change-Id: If062f8336ff5ad113258391b0d70b8ac6f42c4b3 Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 1ff25785ff93d0bd3d597e3a65a261bdbfa13c3b)
* Doc: explain how to create a test touch device for use with touchEventMitch Curtis2020-11-201-1/+7
| | | | | | | Change-Id: Ib60eb0754449da7c50f8632ebd5228ddbe8389f1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 5861e06568c44c58aecacdf26fd7938240348956) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Propagate device-pixel-ratio of system tray iconTor Arne Vestbø2020-11-201-0/+1
| | | | | | | | | | | | | | | | | When preparing a system tray icon on a system with a retina screen, we end up creating a full-height icon of height 44. If there's also a 1x screen available, macOS will scale down this image for us when presenting the icon on the 1 screen, but the downscale will fail to preserve the aspect ratio of the original image on Big Sur. Telling macOS which device-pixel-ratio the image has seems to fix this, and is the right thing to do in any case. Fixes: QTBUG-88600 Change-Id: Ic31def94d073da1b256bbfcaf5905f92c169f43d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit a6aaa2b7071b7666a807b450dc5738742f3cc9e0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* widgets: Don't report new focus object during clearFocus() unless neededTor Arne Vestbø2020-11-201-6/+7
| | | | | | | | | | | | | | | We do not unconditionally clear focus_child like the existing comment said. We only do it if the focus_child was the widget that is clearing focus. So in many cases we'll end up with the same focus object as before. We can not report that as a focusObjectChanged to the window, as that will potentially trigger a reset or cancel of the current input method for the (unchanged) focus object. Fixes: QTBUG-86976 Change-Id: I54367e46eda7a94d967f58960bd926c195dc09cc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 7d5ba1c17ecbb620731ff7322fd278c3ce496dad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Account for Big Sur always enabling layer backed viewsTor Arne Vestbø2020-11-191-2/+9
| | | | | | | | | | | | | | | | | | | | Previous versions of macOS (Mojave and Catalina) enabled layer backing only when the application's build SDK was 10.14 or above, to provide an opt-out workaround for applications that were not ready for layer backing. This seems to no longer be the case, as Big Sur will enable layer backing regardless of the SDK version used. Tested by passing -Wl,-sdk_version -Wl,10.13 -v -mlinker-version=519 during linking, to simulate what the effects of linking to the 10.13 would be. Also confirmed by real-world use of the 10.13 SDK via Xcode 9. Change-Id: I867edc001b6709ba0ad0fd70918bd9b77d317cf8 Fixes: QTBUG-87014 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 2cae34354bd41ae286258c7a6b3653b746e786ae) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: Avoid use-after-free in QXcbConnection::initializeScreens()Alexander Volkov2020-11-181-2/+4
| | | | | | | | | | | | Extend the scope of the resources variable to avoid its destruction while it's still in use. Fixes: QTBUG-88512 Change-Id: I3298aabc871ff455bd1203ec276e7600d3e151ef Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 86b8c5c3f32c245795e9eab2a74e4b6982e5a496) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QRectF/QPointF/QSizeF: document that operator== and != are fuzzyGiuseppe D'Angelo2020-11-183-8/+37
| | | | | | | | | | | This has been the case for a _very_ long time, and I can't believe this hasn't been documented anywhere. Change-Id: Ib157edf14e87a6f546c155496f70a760ab218cca Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit cca62a7360a117880eea5821fd7403d68a1431c8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMutex: order reads from QMutexPrivate::waiters and QBasicMutex::d_ptr in ↵Alexander Kartashov2020-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QBasicMutex::lockInternal() Threads that unlock and lock a mutex at the same time perform the following operations: Thread 1 Thread 2 -------- -------- QBasicMutex::lockInternal() QBasicMutex::unlockInternal() d_ptr.testAndSetOrdered(..., d) d = d_ptr.loadAcquire() d->waiters.loadRelaxed(); (1) d->waiters.fetchAndAddRelease() (2) d_ptr.testAndSetRelease(d, 0) (3) d->derefWaiters() (4) d->waiters.testAndSetRelaxed(...) (5) if (d != d_ptr.loadAcquire()) (6) d->wait() The operation (1) isn't serialized with the operation (6) so its memory effect may be observed before the effect of the operation (1). However, if memory effects are observed in the following order: (6) -> (1) -> (2) -> (3) -> (4) -> (5) then Thread 1 doesn't notice that Thread 2 updates d_ptr and goes to sleep with d pointing to a stale object, this object isn't reachable since d_ptr is zeroed so Thread 1 cannot be woken up. The patch adds the "acquire" barrier into the operation (1) so that it cannot be reordered with the operation (6). Fixes: QTBUG-88247 Change-Id: I1d0c405c0bf5080ec1815d351b9b4b75efeab21a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit d08e3b6de16118becaada17a58aed4042f400a5a)
* Fix x-height name in stylesheet docsFlorian Bruhin2020-11-181-1/+1
| | | | | | | | | | | | The *height* of an x being called "ex width" makes no sense. Also, it seems like this measurement is typically called "x-height" rather than "ex height", see e.g. https://en.wikipedia.org/wiki/X-height Change-Id: Id8e2c1aa9be1a4a60e667a076486777d34f1e76d Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit befa3729db0d1010694bd1bb4cbadd36ff5c49fb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMacStyle: fix tab widget renderingTimur Pocheptsov2020-11-111-2/+83
| | | | | | | | | | | | | | This patch-set combines two recent patches for Big Sur (hiding 'disclose' button on a NSPopUpButton) and adjusting for (now) visible button's round corners. Since it makes little sense to only partially fix the thing, we also backport another change (not so recent, missed 5.12 in the past) that corrects clipping (where we are trying to cut NSBox'es frame, which otherwise is semi-visible through semi-transparent buttons in the 'Dark' theme). Task-number: QTBUG-86513 Change-Id: Ieea5a47ba3073eb564594039895cf70a0a34e7be Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Q_PRIMITIVE_TYPE: improve the documentationGiuseppe D'Angelo2020-11-101-2/+3
| | | | | | | | | | | | | | A key piece of information missing from Q_PRIMITIVE_TYPE documentation is that for them value initialization must equal memset()ting with zeroes. A type like QPoint is primitive because `QPoint p;` is initialized to (0, 0), but a type like QSize is movable (and NOT primitive) because `QSize s;` is actually initialized to (-1, -1). Amend the docs. Change-Id: I121684810da46be5d0579c7d3de945149390a32a Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit b8b75cdcfa71189c7726607be7b66d0ddeaae372) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS + FreeType: fix crash with non printable unicodeAnton Kudryavtsev2020-11-051-1/+4
| | | | | | | | Task-number: QTBUG-84096 Change-Id: Ia60b7094ef9e82cf24f5a8b7995000ae65bb379a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit ebfd0b14aadc8d7e1415fa6a698038dffd251cb0) Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
* Revert changes in strto(u)ll.c to avoid integer overflowsRobert Loehning2020-11-054-25/+36
| | | | | | | | Found in oss-fuzz issue 26045. Change-Id: Id9eac1b4f67ad9bbe2d92dd69cd03338a6ced74e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 2096400d6e8249e49df049f9600073fb2219c97a)
* Fix gui build without feature.highdpiscalingTasuku Suzuki2020-11-021-0/+2
| | | | | | | (cherry picked from commit b75e6e00b7c41b46179b69b0f1bcfc8d497cb59b) Change-Id: Ic206cb6fa1b9fae1db9923ef6596852e93b3cbe5 Fixes: QTBUG-87659 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix locale look-up when language is unspecifiedEdward Welbourne2020-10-281-5/+15
| | | | | | | | | | | | Looking up a locale with unspecified language got the C locale, due to taking a short-cut that would make sense if no locale were found for a specified language. Stop assuming the language was specified. Task-number: QTBUG-74287 Change-Id: I8b3c232da584fb187ebb6c190729c377d0083808 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit e69b81101c6e09d1c1b81d50ea868a8625c9f248) Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QLayout docs: explain better what the QWidget ctor arg doesAhmad Samir2020-10-274-23/+53
| | | | | | | | | | | Make it clear in the docs that an alternative to calling QWidget::setLayout() is to pass the parent widget to the Q*BoxLayout constructor. This basically just copies the relevant bits from the the docs of QWidget and Q*Layout. Change-Id: Id196dcdf9a876d9141aa145f23a83c45f8cda5f8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 1e904ab342c1aaabbef67cbcc25cf3de9e35e755) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Deal with {und,ov}erflow issues in QLine's length handlingEdward Welbourne2020-10-272-18/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use std::hypot() instead of sqrt() of a sum of squares. This ensures length() can't be zero when isNull() is false. Use length() in QLine::setLength() rather than duplicating that. Clarify and expand some documentation; isNull() never said what constituted validity, nor did unitVector() mention that is should not be used on a line for which isNull() is true. Make clear that lines of denormal length cannot be rescaled accurately. Given that we use fuzzy comparison to determine equality of end-points, isNull() can be false for a line with displacements less than sqrt(numeric_limits<qreal>::denorm_min()) between the coordinates of its end-points (as long as these are not much bigger); squaring these would give zero, hence a zero length, where using hypot() avoids the underflow and gives a non-zero length. Having a zero length for a line with isNull() false would lead to problems in setLength(), which uses an isNull() pre-test, protecting a call to unitVector(). (It was already possible for a null line to have non-zero length; this now arises in more cases.) Reworked QLine::setLength() to allow for the possibility that the unit vector it computes as transient may not have length exactly one. Add tests against {ov,und}erflow and divide-by-zero problems in QLine. Picked version for 5.12 needed to adapt the test to simulate 5.15 and later's QCOMPARE(act, exp) effectively testing qFuzzyIsNull(exp) ? qFuzzyIsNull(act) : qFuzzyCompare(act, exp) where 5.12 just uses plain qFuzzyCompare(). Change-Id: I7b71d66b872ccc08a64e941acd36b45b0ea15fab Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> (cherry picked from commit 1c591fd9246ca776304a3c370dd2578bd886feac) Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix race in QFseventsFileSystemWatcher destructorErik Verbruggen2020-10-261-6/+8
| | | | | | | | | | | | | | | | | | | | | | | The race goes like this: 1) We destruct QFseventsFileSystemWatcher, which calls FSEventStreamStop and FSEventStreamInvalidate/FSEventStreamRelease 2) The FSEvent* calls will happen on the same thread as the destructor is being called on, which will be different to the thread that the FSEvent* events are popping out on. 3) So, there could be a case where we are in the middle of processing an event, but the QFseventsFileSystemWatcher has already died. The fix is to dispatch the stop/invalidate/release on the queue associated with the stream. Patch by Matt Galloway! Fixes: QTBUG-85594 Change-Id: Ie168bbe91e55c5559632b37bc008e11597e4fdaf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 6533d1a47309956e8acda90eb4c41d245e817c93) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix included license text for PCRE2 - Stack-less Just-In-Time CompilerKai Koehne2020-10-261-1/+1
| | | | | | | | | | [ChangeLog][Third-Party Code] Changed license text of "PCRE2 - Stack-less Just-In-Time Compiler" component. The documentation (incorrectly) included the generic PCRE2 license so far. Change-Id: I7b36a640ba83fb6087fe28d77f9435af13f8c84d Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit ae18502151fff72885237897f1ffff79166e536c)
* sqlite: Upgrade to 3.33.0Andy Shaw2020-10-173-9937/+10673
| | | | | | | | | [ChangeLog][QtSQL][sqlite] Upgraded to v3.33.0 Change-Id: I379d8c62b449d4c6b04e5154c8c1a86761e5466e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit a9982e64eb5108e5c4b51a4e5738c08eff6d07e7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix copyright year of tinycborKai Koehne2020-10-121-1/+1
| | | | | | | | | | | [ChangeLog][Third-Party Code] Fix aggregated copyright information of TinyCBOR component to reflect the years in the individual source files. Note that this is not same as the Copyright year in the upstream MIT license text. Change-Id: I238d973d937fbfc3a81627c4c65491fbb5cb3c30 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 7c12c8d113b9a7eae00e06ba75a6c6cce0d97d3d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve QWizard visuals for macOS dark modeDavid Skoland2020-10-121-10/+30
| | | | | | | | | | | | | | | | | | This did not account for macOS dark mode, with hardcoded white, but now it correctly updates the colors from palette whenever the theme is changed. Additionally changed some bool checks to make sure the code runs on macOS theme updates. Do note that this change affects Qt Maintenance Tool (in a good way). Change-Id: I6fb92d3f6c15a7ff83d0d8a30cf82477b6aba126 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io> (cherry picked from commit 62fed23fefef0738ef55a17f96efd49e30313152) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Link to qAlpha in qRgb() and qRgba() docsMitch Curtis2020-10-121-2/+2
| | | | | | | Change-Id: I5a3b8573123e82f4c8c92fa7a2e1af06e2e84eb2 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> (cherry picked from commit 418389c3ed925b2da3538d808ceeb53727978a8c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid heap-buffer-overflowRobert Loehning2020-10-121-1/+1
| | | | | | | | | | [ChangeLog][QCosmeticStroker] Avoid a heap-buffer-overflow found by oss- fuzz as issue 25243. Change-Id: I36112f183241679e172ad1ee531e1b929d6f3815 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 1d778a59f781ecf822c9e3f7777b680fea2c4e62) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid overflows in variantHash()Robert Loehning2020-10-081-2/+2
| | | | | | | Fixes: oss-fuzz-24702 Change-Id: I876bac9e2c276693e59802dfeeea2229a873ee34 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit e0da5159dc4f53fcf725ef6e3aa4e04862bcbae0)
* Avoid heap-buffer-overflowRobert Loehning2020-09-251-0/+2
| | | | | | | | | | [ChangeLog][QOutlineMapper] Avoid heap-buffer-overflow Fixes: oss-fuzz-24615 Change-Id: Ia67e1fb830850d04f068d8b5c009687f3deff156 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 74146e0102d367c5e7a3567ad6bf8a46548d55de) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QFontEngine: Do not call getSfntTable with uninitalized valueChristoph Schleifenbaum2020-09-241-2/+2
| | | | | | | | | | | On FreeType font engine this results in a call to FT_Load_Sfnt_Table with a pointer to an uninitialized value passed in as FT_ULong* length, crashing. Instead initialize value to 0. Change-Id: I50d6df3b2296a05640d939e862bc50adb0fec921 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit e041f5459660eaa7108fa5888e77e64f7d1b3d1d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Don't assume NSSlider is never flippedTor Arne Vestbø2020-09-231-7/+7
| | | | | | | | | | | | | | We need to take into account the possibility that the slider is flipped, otherwise we end up with inverted rects, as noticed in Big Sur. The logic to use the ticks as input to whether the bar rect should be inverted didn't make sense. If the graphics context has been flipped, then we should reflect that through the slider. Change-Id: I3574027c14807460affb42a9763211981c4ed528 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit e4f647e2720612d030e4a2240a00500054bbda99) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QXmlStreamReader: Don't resize readBuffer to a size it already hasRobert Loehning2020-09-221-1/+2
| | | | | | | | | | | Resizing it to 0 will cause it to allocate memory. This will then cause append() to copy the data from the other string instead of using copy on write. Task-number: oss-fuzz-24347 Change-Id: I581bd109f9b973e1c70b7b41b1f610a2ad5725b8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 3e3fdbe831f24365780383b3c45a3d53f23ba435)
* QTextHtmlParserNode: Avoid extreme values for font's pixelsizeRobert Loehning2020-09-221-0/+2
| | | | | | | | | | | They currently cause an integer-overflow in variantHash(). Fixes: oss-fuzz-24702 Change-Id: Ibee4413ca766c8ade9aeff2f2052b82cb9f7d213 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 0bd770fb875d5391dd78df95542c25bd15051938) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Gif decoder: fix read error caused by ub checkEirik Aavitsland2020-09-211-5/+7
| | | | | | | | | | | | The recently added check to avoid negative-bitshift ub ignored that the algorithm will sometimes use a negative bitcount value as a flag. This caused reading failure for some frames. Fixes: QTBUG-86702 Change-Id: I4c247a7eb6102f9b51cc8ac708c60db80d609e38 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit f1c1f444811643acda66aaeb21a9e73a8e60e830) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Improve WinTab license informationKai Koehne2020-09-201-2/+2
| | | | | | | | | | | | | | | | | | Do categorize the license as LCS-Telegraphics License. Although SPDX doesn't know about the license (yet), DejaCode does: https://enterprise.dejacode.com/licenses/public/lcs-telegraphics/ So it's more helpful for the user to give the license a name, then to just call it 'Custom'. [ChangeLog][Third-Party Code] Changed classification of the wintab license from "Custom" to "LCS-Telegraphics License" Change-Id: Iba7538f67b43ceca2e599fc1ede520962d4a7e43 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 29ed90a147d0b4f65cc0a447e533af9338c6bdf4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QDir: add note to docs about isAbsolutePath(":foo") returning trueAhmad Samir2020-09-201-1/+5
| | | | | | | | | | | | As can be seen in the _q_resolveEntryAndCreateLegacyEngine_recursive method in QFileSystemEngine, paths starting with ':' are treated as QResources, which means that from QFileInfo's POV they're "not relative", which is why QDir::isAbsolutePath would return true. Change-Id: I701d08ce43ea707bc34c928e39bea0b83597a4b6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 0da5726a43b21d1532720c8cd3c687cc2373cd2b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix a double deletion in QDomAttr::setNodeValue()Friedemann Kleint2020-09-191-1/+3
| | | | | | | | | | | Check the reference count before deleting. Patch as contributed on bug report. Fixes: QTBUG-86547 Change-Id: I2cb197e3eeda7ade2442c23f6b4f1ae6ff2ff810 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit af22ccf5605c6b7b20b845fb2b4003d3f56d8bc9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xpm handler: fix read error caused by off-by-one in overflow checkEirik Aavitsland2020-09-181-2/+2
| | | | | | | | | | | | | | The recently introduced overflow check for 8 bit images was too aggressive, causing the last pixel on each line to be rejected. As a driveby, add the same (fixed) overflow check also for 32bit images. Fixes: QTBUG-86691 Change-Id: I62e4d5884e314f1171cb5a3e2c48657ce7259676 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 6f2c7469f86785e6ba81fe0280210ef7275099de) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Don't assume we will get didBecomeKey for non-Qt NSWindowsTor Arne Vestbø2020-09-141-9/+11
| | | | | | | | | | | | The optimization resulted in losing out on window focus changes when for example a native file dialog was shown, resulting in the cursor blinking both in the parent window, and in the native file dialog. Change-Id: I9c1f9df20fbc5c4b80f906ded70d9a2658b70438 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 5fbb17c39785ed2c80219c9c0ea97879e371d490) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: explain how to blacklist QML tests on certain platformsMitch Curtis2020-09-111-2/+20
| | | | | | | Change-Id: Icd505175805820c64593d7eb8f580a51008e2e1a Reviewed-by: Daniel Smith <Daniel.Smith@qt.io> (cherry picked from commit a4e4436e852c600a7ecd13b83fc487164dbc5ad7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make clang-format ignore formatting of third party codeEirik Aavitsland2020-09-101-0/+2
| | | | | | | Change-Id: I865f86a1f9967971c4e525e634279a26ce11f688 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 7d27316d9fe736fd863dbd389571ee7906d6e559) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid potential ub in corrupt bmp fileEirik Aavitsland2020-09-101-0/+2
| | | | | | | | | | | biHeight may be int_min, in which case qAbs<int>() will not work. Fixes: oss-fuzz-22997 Change-Id: Ic07d5aa0b4e4f2b6395e1a12d742e31b5282fdfc Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 6f909a5178296855cdd53b053ced9c551a2474a6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>