[neon/qt/qtsvg/Neon/release] debian/patches: add patch recommended by qt
Jonathan Esk-Riddell
null at kde.org
Mon May 22 14:38:25 BST 2023
Git commit 2a7ea7f7b82449dc5307468fd79a1933e15471bc by Jonathan Esk-Riddell.
Committed on 22/05/2023 at 13:38.
Pushed by jriddell into branch 'Neon/release'.
add patch recommended by qt
A +47 -0 debian/patches/CVE-2023-32763-qtbase-5.15.diff
A +1 -0 debian/patches/series
https://invent.kde.org/neon/qt/qtsvg/commit/2a7ea7f7b82449dc5307468fd79a1933e15471bc
diff --git a/debian/patches/CVE-2023-32763-qtbase-5.15.diff b/debian/patches/CVE-2023-32763-qtbase-5.15.diff
new file mode 100644
index 0000000..c6aa192
--- /dev/null
+++ b/debian/patches/CVE-2023-32763-qtbase-5.15.diff
@@ -0,0 +1,47 @@
+--- a/src/gui/painting/qfixed_p.h
++++ b/src/gui/painting/qfixed_p.h
+@@ -54,6 +54,7 @@
+ #include <QtGui/private/qtguiglobal_p.h>
+ #include "QtCore/qdebug.h"
+ #include "QtCore/qpoint.h"
++#include <QtCore/private/qnumeric_p.h>
+ #include "QtCore/qsize.h"
+
+ QT_BEGIN_NAMESPACE
+@@ -182,6 +183,14 @@ Q_DECL_CONSTEXPR inline bool operator<(int i, const QFixed &f) { return i * 64 <
+ Q_DECL_CONSTEXPR inline bool operator>(const QFixed &f, int i) { return f.value() > i * 64; }
+ Q_DECL_CONSTEXPR inline bool operator>(int i, const QFixed &f) { return i * 64 > f.value(); }
+
++inline bool qAddOverflow(QFixed v1, QFixed v2, QFixed *r)
++{
++ int val;
++ bool result = add_overflow(v1.value(), v2.value(), &val);
++ r->setValue(val);
++ return result;
++}
++
+ #ifndef QT_NO_DEBUG_STREAM
+ inline QDebug &operator<<(QDebug &dbg, const QFixed &f)
+ { return dbg << f.toReal(); }
+
+
+--- a/src/gui/text/qtextlayout.cpp
++++ b/src/gui/text/qtextlayout.cpp
+@@ -2163,11 +2163,14 @@ found:
+ eng->maxWidth = qMax(eng->maxWidth, line.textWidth);
+ } else {
+ eng->minWidth = qMax(eng->minWidth, lbh.minw);
+- eng->maxWidth += line.textWidth;
++ if (qAddOverflow(eng->maxWidth, line.textWidth, &eng->maxWidth))
++ eng->maxWidth = QFIXED_MAX;
+ }
+
+- if (line.textWidth > 0 && item < eng->layoutData->items.size())
+- eng->maxWidth += lbh.spaceData.textWidth;
++ if (line.textWidth > 0 && item < eng->layoutData->items.size()) {
++ if (qAddOverflow(eng->maxWidth, lbh.spaceData.textWidth, &eng->maxWidth))
++ eng->maxWidth = QFIXED_MAX;
++ }
+
+ line.textWidth += trailingSpace;
+ if (lbh.spaceData.length) {
\ No newline at end of file
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..ab721e7
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+CVE-2023-32763-qtbase-5.15.diff
More information about the Neon-commits
mailing list