qt5base-lts/src
Giuseppe D'Angelo f0d1f50e02 QRegularExpression: fix matching over null/empty QString(View)
An empty QString(View) is allowed to have nullptr as its data pointer
(of course, only if its size is 0). This wasn't properly
checked in QRegularExpression, which passed such nullptr to
PCRE, and that resulted in PCRE raising an error (PCRE_ERROR_NULL).
Detect this case and pass a dummy pointer to keep PCRE happy.

Fixing and testing this in turn exposed a problem with QStringView
support in QRegularExpression when used over a null QString: the
code is supposed to use the QStringView(QString) constructor and NOT
qToStringViewIgnoringNull. That's because QRE distinguishes null
and empty subjects; when using qToStringViewIgnoringNull over
a null QString, one gets a non-null QStringView (!). Again, this in
turn exposed a problem with a QRegularExpression autotest that assumed
that a null match could only mean "no match" (instead, it can happen at
position 0 of a null QString(View)).

Change-Id: Ifb3cf14dec42ce76fcdbcb07ea1d80784d52ef65
Pick-to: 6.1 6.2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-08-19 08:48:52 +02:00
..
3rdparty Update bundled Freetype to 2.10.4 2021-08-16 17:26:29 +00:00
android Fix Style java code format and warnings 2021-08-15 14:02:41 +03:00
concurrent QtConcurrent: fix examples of overloaded methods in docs 2021-08-18 22:31:17 +02:00
corelib QRegularExpression: fix matching over null/empty QString(View) 2021-08-19 08:48:52 +02:00
dbus QDBusMarshaller: fix -Wformat-overflow 2021-07-08 01:49:26 +02:00
entrypoint Adjust the EntryPoint target name according to the internal module naming policy 2021-06-15 12:51:49 +02:00
gui qpnghandler: Only assume we're past the input size if it returns a size 2021-08-19 02:27:28 +02:00
network QDecompressHelper: Skip double-decompression if download is small 2021-08-04 19:31:52 +02:00
opengl CMake: Make WrapVulkanHeaders target optional for QtGui consumers 2021-07-29 16:38:50 +02:00
openglwidgets Migrate to autogenerated cpp exports 2021-06-25 19:33:12 +02:00
platformsupport Fix button type to update coordinates when dragging 2021-08-11 12:38:35 +00:00
plugins MySQL: pedantism: create and destroy the MYSQL_TIME type 2021-08-18 15:39:05 -07:00
printsupport Fix printing with unhinted fonts 2021-08-16 20:20:26 +02:00
sql Doc: Ensure deprecated APIs in Qt Sql are documented as such 2021-07-22 07:08:56 +02:00
testlib Add note on selecting the device which is used to run tests on Android 2021-08-18 19:53:38 +00:00
tools moc: Support BINDABLE for private properties 2021-08-06 17:25:50 +02:00
widgets Report ImAbsolutePosition for QLineEdit 2021-08-18 20:06:05 +02:00
xml Migrate to autogenerated cpp exports 2021-06-25 19:33:12 +02:00
CMakeLists.txt Make it possible to disable the PrintSupport module 2021-02-09 09:17:21 +01:00