forked from pool/libqt5-qtbase
Fabian Vogt
0141bdac91
- Add mitigate-FORTIFY_SOURCE-3.patch that should mitigate new -D_FORTIFY_SOURCE=3 level as analyzed in GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105078. OBS-URL: https://build.opensuse.org/request/show/969342 OBS-URL: https://build.opensuse.org/package/show/KDE:Qt:5.15/libqt5-qtbase?expand=0&rev=36
36 lines
1.1 KiB
Diff
36 lines
1.1 KiB
Diff
From: Martin Liška <mliska@suse.cz>
|
|
Subject: Mitigate issue with -D_FORTIFY_SOURCE=3 seen with GCC 12
|
|
|
|
GCC upstream bug for it:
|
|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105078
|
|
|
|
diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h
|
|
index dcd95924..d01739e7 100644
|
|
--- a/src/corelib/tools/qarraydata.h
|
|
+++ b/src/corelib/tools/qarraydata.h
|
|
@@ -42,6 +42,7 @@
|
|
|
|
#include <QtCore/qrefcount.h>
|
|
#include <string.h>
|
|
+#include <cstdint>
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
@@ -58,14 +59,14 @@ struct Q_CORE_EXPORT QArrayData
|
|
{
|
|
Q_ASSERT(size == 0
|
|
|| offset < 0 || size_t(offset) >= sizeof(QArrayData));
|
|
- return reinterpret_cast<char *>(this) + offset;
|
|
+ return reinterpret_cast<void *> (reinterpret_cast<uintptr_t>(this) + offset);
|
|
}
|
|
|
|
const void *data() const
|
|
{
|
|
Q_ASSERT(size == 0
|
|
|| offset < 0 || size_t(offset) >= sizeof(QArrayData));
|
|
- return reinterpret_cast<const char *>(this) + offset;
|
|
+ return reinterpret_cast<void *> (reinterpret_cast<uintptr_t>(this) + offset);
|
|
}
|
|
|
|
// This refers to array data mutability, not "header data" represented by
|