[neon/qt/qtbase/Neon/release] debian/patches: sync patches

Jonathan Esk-Riddell null at kde.org
Thu Jul 14 13:51:31 BST 2022


Git commit 4c9f89bd004a21b875feb6a15ae58f2f6586d7d5 by Jonathan Esk-Riddell.
Committed on 14/07/2022 at 12:51.
Pushed by jriddell into branch 'Neon/release'.

sync patches

M  +9    -5    debian/patches/fix_recursion_crash.diff
M  +9    -5    debian/patches/moc_handle_include.diff
A  +21   -0    debian/patches/qiodevice_readline_memory.diff
A  +25   -0    debian/patches/qnam_connect_memory_leak.diff
M  +6    -7    debian/patches/series
A  +26   -0    debian/patches/xcb_screens_uaf.patch
A  +18   -0    debian/patches/xdg_filechooser_portal_send_window_id_in_hex.diff

https://invent.kde.org/neon/qt/qtbase/commit/4c9f89bd004a21b875feb6a15ae58f2f6586d7d5

diff --git a/debian/patches/fix_recursion_crash.diff b/debian/patches/fix_recursion_crash.diff
index 6ee2ebe..2834f26 100644
--- a/debian/patches/fix_recursion_crash.diff
+++ b/debian/patches/fix_recursion_crash.diff
@@ -8,9 +8,11 @@ Description: fix recursion crash when calling setStyleSheet with qproperty-style
 Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=e9cdcc7cb314586a
 Last-Update: 2021-11-13
 
---- a/src/widgets/styles/qstylesheetstyle.cpp
-+++ b/src/widgets/styles/qstylesheetstyle.cpp
-@@ -2646,6 +2646,9 @@ void QStyleSheetStyle::setProperties(QWi
+Index: qtbase/src/widgets/styles/qstylesheetstyle.cpp
+===================================================================
+--- qtbase.orig/src/widgets/styles/qstylesheetstyle.cpp
++++ qtbase/src/widgets/styles/qstylesheetstyle.cpp
+@@ -2649,6 +2649,9 @@ void QStyleSheetStyle::setProperties(QWi
          default: v = decl.d->values.at(0).variant; break;
          }
  
@@ -20,8 +22,10 @@ Last-Update: 2021-11-13
          w->setProperty(propertyL1, v);
      }
  }
---- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
-+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+Index: qtbase/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+===================================================================
+--- qtbase.orig/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
++++ qtbase/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
 @@ -94,6 +94,7 @@ private slots:
      void layoutSpacing();
  #endif
diff --git a/debian/patches/moc_handle_include.diff b/debian/patches/moc_handle_include.diff
index a337b49..1a7b9cd 100644
--- a/debian/patches/moc_handle_include.diff
+++ b/debian/patches/moc_handle_include.diff
@@ -7,9 +7,11 @@ Description: handle even more include in enum cases
 Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=87973325f1b99f2b
 Last-Update: 2022-04-07
 
---- a/src/tools/moc/moc.cpp
-+++ b/src/tools/moc/moc.cpp
-@@ -305,10 +305,9 @@ bool Moc::parseEnum(EnumDef *def)
+Index: qtbase/src/tools/moc/moc.cpp
+===================================================================
+--- qtbase.orig/src/tools/moc/moc.cpp
++++ qtbase/src/tools/moc/moc.cpp
+@@ -306,10 +306,9 @@ bool Moc::parseEnum(EnumDef *def)
              return IncludeState::NoInclude;
      };
      do {
@@ -21,8 +23,10 @@ Last-Update: 2022-04-07
          next(IDENTIFIER);
          def->values += lexem();
          handleInclude();
---- a/tests/auto/tools/moc/enum_with_include.h
-+++ b/tests/auto/tools/moc/enum_with_include.h
+Index: qtbase/tests/auto/tools/moc/enum_with_include.h
+===================================================================
+--- qtbase.orig/tests/auto/tools/moc/enum_with_include.h
++++ qtbase/tests/auto/tools/moc/enum_with_include.h
 @@ -34,6 +34,11 @@ class Foo : public QObject {
      enum en {
         #include <enum_inc.h>
diff --git a/debian/patches/qiodevice_readline_memory.diff b/debian/patches/qiodevice_readline_memory.diff
new file mode 100644
index 0000000..4ce27af
--- /dev/null
+++ b/debian/patches/qiodevice_readline_memory.diff
@@ -0,0 +1,21 @@
+Description: fix allocated memory of QByteArray returned by QIODevice::readLine
+Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=6485b6d45ad165cf
+Last-Update: 2021-02-20
+
+--- a/src/corelib/io/qiodevice.cpp
++++ b/src/corelib/io/qiodevice.cpp
+@@ -1480,10 +1480,12 @@ QByteArray QIODevice::readLine(qint64 ma
+     } else
+         readBytes = readLine(result.data(), result.size());
+ 
+-    if (readBytes <= 0)
++    if (readBytes <= 0) {
+         result.clear();
+-    else
++    } else {
+         result.resize(readBytes);
++        result.squeeze();
++    }
+ 
+     return result;
+ }
diff --git a/debian/patches/qnam_connect_memory_leak.diff b/debian/patches/qnam_connect_memory_leak.diff
new file mode 100644
index 0000000..f16b2bc
--- /dev/null
+++ b/debian/patches/qnam_connect_memory_leak.diff
@@ -0,0 +1,25 @@
+Description: QNAM: work around QObject finicky orphan cleanup details
+Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=0807f16eb407eaf8
+Last-Update: 2021-01-26
+
+--- a/src/network/access/qnetworkreplyhttpimpl.cpp
++++ b/src/network/access/qnetworkreplyhttpimpl.cpp
+@@ -808,7 +808,17 @@ void QNetworkReplyHttpImplPrivate::postR
+ 
+     // For the synchronous HTTP, this is the normal way the delegate gets deleted
+     // For the asynchronous HTTP this is a safety measure, the delegate deletes itself when HTTP is finished
+-    QObject::connect(thread, SIGNAL(finished()), delegate, SLOT(deleteLater()));
++    QMetaObject::Connection threadFinishedConnection =
++            QObject::connect(thread, SIGNAL(finished()), delegate, SLOT(deleteLater()));
++
++    // QTBUG-88063: When 'delegate' is deleted the connection will be added to 'thread''s orphaned
++    // connections list. This orphaned list will be cleaned up next time 'thread' emits a signal,
++    // unfortunately that's the finished signal. It leads to a soft-leak so we do this to disconnect
++    // it on deletion so that it cleans up the orphan immediately.
++    QObject::connect(delegate, &QObject::destroyed, delegate, [threadFinishedConnection]() {
++        if (bool(threadFinishedConnection))
++            QObject::disconnect(threadFinishedConnection);
++    });
+ 
+     // Set the properties it needs
+     delegate->httpRequest = httpRequest;
diff --git a/debian/patches/series b/debian/patches/series
index 089e5da..96c6d94 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,19 +1,18 @@
 # Backported from upstream.
 gcc_11_limits.diff
-mime_globs.diff
 fix-misplacement-of-placeholder-text-in-QLineEdit.diff
 fix-placement-of-placeholder-text-in-QLineEdits-with-action-icons.diff
 full_width_selection_rtl.diff
 fix_recursion_crash.diff
-mysql_field_readonly.diff
-CVE-2021-38593.diff
-openssl3.diff
-CVE-2022-25255.diff
+#mysql_field_readonly.diff
+#CVE-2021-38593.diff
+#openssl3.diff
+#CVE-2022-25255.diff
 moc_handle_include.diff
-remove_limit_on_number_of_streams.diff
+#remove_limit_on_number_of_streams.diff
 
 # Debian specific.
-gnukfreebsd.diff
+#gnukfreebsd.diff
 no_htmlinfo_example.diff
 remove_privacy_breaches.diff
 link_fbclient.diff
diff --git a/debian/patches/xcb_screens_uaf.patch b/debian/patches/xcb_screens_uaf.patch
new file mode 100644
index 0000000..600e10d
--- /dev/null
+++ b/debian/patches/xcb_screens_uaf.patch
@@ -0,0 +1,26 @@
+Description: Avoid use-after-free in QXcbConnection::initializeScreens()
+Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=86b8c5c3f32c2457
+Last-Update: 2020-11-23
+
+--- a/src/plugins/platforms/xcb/qxcbconnection_screens.cpp
++++ b/src/plugins/platforms/xcb/qxcbconnection_screens.cpp
+@@ -290,6 +290,8 @@ void QXcbConnection::initializeScreens()
+             // RRGetScreenResources in this case.
+             auto resources_current = Q_XCB_REPLY(xcb_randr_get_screen_resources_current,
+                                                  xcb_connection(), xcbScreen->root);
++            decltype(Q_XCB_REPLY(xcb_randr_get_screen_resources,
++                                 xcb_connection(), xcbScreen->root)) resources;
+             if (!resources_current) {
+                 qWarning("failed to get the current screen resources");
+             } else {
+@@ -300,8 +302,8 @@ void QXcbConnection::initializeScreens()
+                     timestamp = resources_current->config_timestamp;
+                     outputs = xcb_randr_get_screen_resources_current_outputs(resources_current.get());
+                 } else {
+-                    auto resources = Q_XCB_REPLY(xcb_randr_get_screen_resources,
+-                                                 xcb_connection(), xcbScreen->root);
++                    resources = Q_XCB_REPLY(xcb_randr_get_screen_resources,
++                                            xcb_connection(), xcbScreen->root);
+                     if (!resources) {
+                         qWarning("failed to get the screen resources");
+                     } else {
diff --git a/debian/patches/xdg_filechooser_portal_send_window_id_in_hex.diff b/debian/patches/xdg_filechooser_portal_send_window_id_in_hex.diff
new file mode 100644
index 0000000..76abafe
--- /dev/null
+++ b/debian/patches/xdg_filechooser_portal_send_window_id_in_hex.diff
@@ -0,0 +1,18 @@
+Description: FileChooser portal: send window id in hex
+ We send window id in decimal, however, it is expected to be send in hex.
+ This causes a mismatch and makes portal dialog to show in background.
+Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=acaabc9108dfe75530960cf8e3ec4f3602cd82e0
+Last-Update: 2021-11-04
+Index: qtbase-opensource-src/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp
+===================================================================
+--- qtbase-opensource-src.orig/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp
++++ qtbase-opensource-src/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp
+@@ -185,7 +185,7 @@ void QXdgDesktopPortalFileDialog::openPo
+                                                           QLatin1String("/org/freedesktop/portal/desktop"),
+                                                           QLatin1String("org.freedesktop.portal.FileChooser"),
+                                                           d->saveFile ? QLatin1String("SaveFile") : QLatin1String("OpenFile"));
+-    QString parentWindowId = QLatin1String("x11:") + QString::number(d->winId);
++    QString parentWindowId = QLatin1String("x11:") + QString::number(d->winId, 16);
+ 
+     QVariantMap options;
+     if (!d->acceptLabel.isEmpty())


More information about the Neon-commits mailing list