[neon/qt6/qt6-base] debian/patches: add patch from qt
Jonathan Esk-Riddell
null at kde.org
Mon May 22 14:49:08 BST 2023
Git commit 283d48ed889125d02806973a2751630827ffb08b by Jonathan Esk-Riddell.
Committed on 22/05/2023 at 13:49.
Pushed by jriddell into branch 'master'.
add patch from qt
A +53 -0 debian/patches/CVE-2023-32763-qtbase-6.5.diff
https://invent.kde.org/neon/qt6/qt6-base/commit/283d48ed889125d02806973a2751630827ffb08b
diff --git a/debian/patches/CVE-2023-32763-qtbase-6.5.diff b/debian/patches/CVE-2023-32763-qtbase-6.5.diff
new file mode 100644
index 0000000..9216378
--- /dev/null
+++ b/debian/patches/CVE-2023-32763-qtbase-6.5.diff
@@ -0,0 +1,53 @@
+--- a/src/gui/painting/qfixed_p.h
++++ b/src/gui/painting/qfixed_p.h
+@@ -18,6 +18,7 @@
+ #include <QtGui/private/qtguiglobal_p.h>
+ #include "QtCore/qdebug.h"
+ #include "QtCore/qpoint.h"
++#include "QtCore/qnumeric.h"
+ #include "QtCore/qsize.h"
+
+ QT_BEGIN_NAMESPACE
+@@ -136,6 +137,22 @@ constexpr inline QFixed operator+(uint i, QFixed d) { return d+i; }
+ constexpr inline QFixed operator-(uint i, QFixed d) { return -(d-i); }
+ // constexpr inline QFixed operator*(qreal d, QFixed d2) { return d2*d; }
+
++inline bool qAddOverflow(QFixed v1, QFixed v2, QFixed *r)
++{
++ int val;
++ bool result = qAddOverflow(v1.value(), v2.value(), &val);
++ r->setValue(val);
++ return result;
++}
++
++inline bool qMulOverflow(QFixed v1, QFixed v2, QFixed *r)
++{
++ int val;
++ bool result = qMulOverflow(v1.value(), v2.value(), &val);
++ r->setValue(val);
++ return result;
++}
++
+ #ifndef QT_NO_DEBUG_STREAM
+ inline QDebug &operator<<(QDebug &dbg, QFixed f)
+ { return dbg << f.toReal(); }
+
+
+--- a/src/gui/text/qtextlayout.cpp
++++ b/src/gui/text/qtextlayout.cpp
+@@ -2164,9 +2164,12 @@ found:
+ eng->maxWidth = qMax(eng->maxWidth, line.textWidth);
+ } else {
+ eng->minWidth = qMax(eng->minWidth, lbh.minw);
+- eng->layoutData->currentMaxWidth += line.textWidth;
+- if (!manuallyWrapped)
+- eng->layoutData->currentMaxWidth += lbh.spaceData.textWidth;
++ if (qAddOverflow(eng->layoutData->currentMaxWidth, line.textWidth, &eng->layoutData->currentMaxWidth))
++ eng->layoutData->currentMaxWidth = QFIXED_MAX;
++ if (!manuallyWrapped) {
++ if (qAddOverflow(eng->layoutData->currentMaxWidth, lbh.spaceData.textWidth, &eng->layoutData->currentMaxWidth))
++ eng->layoutData->currentMaxWidth = QFIXED_MAX;
++ }
+ eng->maxWidth = qMax(eng->maxWidth, eng->layoutData->currentMaxWidth);
+ if (manuallyWrapped)
+ eng->layoutData->currentMaxWidth = 0;
\ No newline at end of file
More information about the Neon-commits
mailing list