summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2020-01-23 11:53:12 +0200
committerKari Oikarinen <kari.oikarinen@qt.io>2020-01-23 11:53:12 +0200
commit9d43d55b21bceb2ec9c128e2ef216ba1dbe2d097 (patch)
treee0c84754a33d73b85c90256ad7a91ab0091fb9d0 /src
parent182868f4d0003c9f30254d31d41b623eb4fa7273 (diff)
parent303e9168eb912ef3c1f5e504b5aa45a3eed5d757 (diff)
Merge 5.12 into 5.12.7
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/sqlite/patches/0004-Fix-CVE-2019-19646-in-SQLite.patch29
-rw-r--r--src/3rdparty/sqlite/sqlite3.c4
-rw-r--r--src/platformsupport/input/libinput/qlibinputtouch.cpp40
-rw-r--r--src/platformsupport/input/libinput/qlibinputtouch_p.h7
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp8
5 files changed, 80 insertions, 8 deletions
diff --git a/src/3rdparty/sqlite/patches/0004-Fix-CVE-2019-19646-in-SQLite.patch b/src/3rdparty/sqlite/patches/0004-Fix-CVE-2019-19646-in-SQLite.patch
new file mode 100644
index 0000000000..db436ab4f6
--- /dev/null
+++ b/src/3rdparty/sqlite/patches/0004-Fix-CVE-2019-19646-in-SQLite.patch
@@ -0,0 +1,29 @@
+From a83bbce4d6f31d93ea4d2a681aa52c148f148e26 Mon Sep 17 00:00:00 2001
+From: Andy Shaw <andy.shaw@qt.io>
+Date: Thu, 2 Jan 2020 09:07:08 +0100
+Subject: [PATCH] Fix CVE-2019-19646 in SQLite
+
+Task-number: QTBUG-81020
+Change-Id: I7176db20d4a44b1fb443a6108675f719e9643343
+---
+ src/3rdparty/sqlite/sqlite3.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
+index 57e61b8313..980a149b1a 100644
+--- a/src/3rdparty/sqlite/sqlite3.c
++++ b/src/3rdparty/sqlite/sqlite3.c
+@@ -123765,7 +123765,9 @@ SQLITE_PRIVATE void sqlite3Pragma(
+ if( j==pTab->iPKey ) continue;
+ if( pTab->aCol[j].notNull==0 ) continue;
+ sqlite3ExprCodeGetColumnOfTable(v, pTab, iDataCur, j, 3);
+- sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG);
++ if( sqlite3VdbeGetOp(v,-1)->opcode==OP_Column ){
++ sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG);
++ }
+ jmp2 = sqlite3VdbeAddOp1(v, OP_NotNull, 3); VdbeCoverage(v);
+ zErr = sqlite3MPrintf(db, "NULL value in %s.%s", pTab->zName,
+ pTab->aCol[j].zName);
+--
+2.21.0 (Apple Git-122.2)
+
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
index d392320ba4..d5b43857ad 100644
--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -123785,7 +123785,9 @@ SQLITE_PRIVATE void sqlite3Pragma(
if( j==pTab->iPKey ) continue;
if( pTab->aCol[j].notNull==0 ) continue;
sqlite3ExprCodeGetColumnOfTable(v, pTab, iDataCur, j, 3);
- sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG);
+ if( sqlite3VdbeGetOp(v,-1)->opcode==OP_Column ){
+ sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG);
+ }
jmp2 = sqlite3VdbeAddOp1(v, OP_NotNull, 3); VdbeCoverage(v);
zErr = sqlite3MPrintf(db, "NULL value in %s.%s", pTab->zName,
pTab->aCol[j].zName);
diff --git a/src/platformsupport/input/libinput/qlibinputtouch.cpp b/src/platformsupport/input/libinput/qlibinputtouch.cpp
index a65bc91c39..7a8eaf577a 100644
--- a/src/platformsupport/input/libinput/qlibinputtouch.cpp
+++ b/src/platformsupport/input/libinput/qlibinputtouch.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qlibinputtouch_p.h"
+#include "qtouchoutputmapping_p.h"
#include <libinput.h>
#include <QtGui/QGuiApplication>
#include <QtGui/QScreen>
@@ -45,6 +46,8 @@
QT_BEGIN_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(qLcLibInput)
+
QWindowSystemInterface::TouchPoint *QLibInputTouch::DeviceState::point(int32_t slot)
{
const int id = qMax(0, slot);
@@ -62,12 +65,23 @@ QLibInputTouch::DeviceState *QLibInputTouch::deviceState(libinput_event_touch *e
return &m_devState[dev];
}
-static inline QPointF getPos(libinput_event_touch *e)
+QPointF QLibInputTouch::getPos(libinput_event_touch *e)
{
- // TODO Map to correct screen using QTouchOutputMapping.
- // Perhaps investigate libinput_device_get_output_name as well.
- // For now just use the primary screen.
+ DeviceState *state = deviceState(e);
QScreen *screen = QGuiApplication::primaryScreen();
+ if (!state->m_screenName.isEmpty()) {
+ if (!m_screen) {
+ const QList<QScreen *> screens = QGuiApplication::screens();
+ for (QScreen *s : screens) {
+ if (s->name() == state->m_screenName) {
+ m_screen = s;
+ break;
+ }
+ }
+ }
+ if (m_screen)
+ screen = m_screen;
+ }
const QRect geom = QHighDpi::toNativePixels(screen->geometry(), screen);
const double x = libinput_event_touch_get_x_transformed(e, geom.width());
const double y = libinput_event_touch_get_y_transformed(e, geom.height());
@@ -76,9 +90,25 @@ static inline QPointF getPos(libinput_event_touch *e)
void QLibInputTouch::registerDevice(libinput_device *dev)
{
+ struct udev_device *udev_device;
+ udev_device = libinput_device_get_udev_device(dev);
+ QString devNode = QString::fromUtf8(udev_device_get_devnode(udev_device));
+ QString devName = QString::fromUtf8(libinput_device_get_name(dev));
+
+ qCDebug(qLcLibInput, "libinput: registerDevice %s - %s",
+ qPrintable(devNode), qPrintable(devName));
+
+ QTouchOutputMapping mapping;
+ if (mapping.load()) {
+ m_devState[dev].m_screenName = mapping.screenNameForDeviceNode(devNode);
+ if (!m_devState[dev].m_screenName.isEmpty())
+ qCDebug(qLcLibInput, "libinput: Mapping device %s to screen %s",
+ qPrintable(devNode), qPrintable(m_devState[dev].m_screenName));
+ }
+
QTouchDevice *&td = m_devState[dev].m_touchDevice;
td = new QTouchDevice;
- td->setName(QString::fromUtf8(libinput_device_get_name(dev)));
+ td->setName(devName);
td->setType(QTouchDevice::TouchScreen);
td->setCapabilities(QTouchDevice::Position | QTouchDevice::Area);
QWindowSystemInterface::registerTouchDevice(td);
diff --git a/src/platformsupport/input/libinput/qlibinputtouch_p.h b/src/platformsupport/input/libinput/qlibinputtouch_p.h
index 6f88001d19..2682b83b26 100644
--- a/src/platformsupport/input/libinput/qlibinputtouch_p.h
+++ b/src/platformsupport/input/libinput/qlibinputtouch_p.h
@@ -42,6 +42,7 @@
#include <QtCore/QHash>
#include <QtCore/QList>
+#include <QtCore/QPointer>
#include <qpa/qwindowsysteminterface.h>
//
@@ -60,6 +61,7 @@ struct libinput_device;
QT_BEGIN_NAMESPACE
+class QScreen;
class QLibInputTouch
{
public:
@@ -73,15 +75,18 @@ public:
private:
struct DeviceState {
- DeviceState() : m_touchDevice(0) { }
+ DeviceState() : m_touchDevice(nullptr), m_screenName() { }
QWindowSystemInterface::TouchPoint *point(int32_t slot);
QList<QWindowSystemInterface::TouchPoint> m_points;
QTouchDevice *m_touchDevice;
+ QString m_screenName;
};
DeviceState *deviceState(libinput_event_touch *e);
+ QPointF getPos(libinput_event_touch *e);
QHash<libinput_device *, DeviceState> m_devState;
+ mutable QPointer<QScreen> m_screen;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
index 81bad45cd2..dbfb0e6058 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
@@ -52,6 +52,7 @@
#include <QScreen>
#include <QDir>
#if QT_CONFIG(regularexpression)
+# include <QFileInfo>
# include <QRegularExpression>
#endif
#include <QLoggingCategory>
@@ -144,7 +145,12 @@ int QEglFSDeviceIntegration::framebufferIndex() const
int fbIndex = 0;
#if QT_CONFIG(regularexpression)
QRegularExpression fbIndexRx(QLatin1String("fb(\\d+)"));
- QRegularExpressionMatch match = fbIndexRx.match(QString::fromLocal8Bit(fbDeviceName()));
+ QFileInfo fbinfo(QString::fromLocal8Bit(fbDeviceName()));
+ QRegularExpressionMatch match;
+ if (fbinfo.isSymLink())
+ match = fbIndexRx.match(fbinfo.symLinkTarget());
+ else
+ match = fbIndexRx.match(fbinfo.fileName());
if (match.hasMatch())
fbIndex = match.captured(1).toInt();
#endif