diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-04-23 16:29:18 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-24 14:39:38 +0200 |
commit | c1623a0d42c9869e5a1d04081e7660722a863de5 (patch) | |
tree | 17a58be3a4c80b143add805b7ff8218daab61106 /src/xmlpatterns/parser | |
parent | c18f589a757b2c4cb8c5e66a92f34ac005223cfe (diff) | |
download | qtxmlpatterns-c1623a0d42c9869e5a1d04081e7660722a863de5.tar.gz |
Don't use the QRegExp methods that modify the object
QRegExp matching methods modify the object, which we don't want to. In
particular, when we receive a QRegExp from the user or we store in a
context that might require thread-safety, make sure we make a copy
before using it.
QRegularExpression has no such shortcoming.
Task-number: QTBUG-25064
Change-Id: I2c4d5f4b60d6b3569568103cd7107cd2adaa3ae8
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/xmlpatterns/parser')
-rw-r--r-- | src/xmlpatterns/parser/qquerytransformparser.cpp | 2 | ||||
-rw-r--r-- | src/xmlpatterns/parser/querytransformparser.ypp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/xmlpatterns/parser/qquerytransformparser.cpp b/src/xmlpatterns/parser/qquerytransformparser.cpp index 25821ca..781b899 100644 --- a/src/xmlpatterns/parser/qquerytransformparser.cpp +++ b/src/xmlpatterns/parser/qquerytransformparser.cpp @@ -3735,7 +3735,7 @@ yyreduce: /* Line 1269 of yacc.c. */ #line 1412 "querytransformparser.ypp" { - const QRegExp encNameRegExp(QLatin1String("[A-Za-z][A-Za-z0-9._\\-]*")); + QRegExp encNameRegExp(QLatin1String("[A-Za-z][A-Za-z0-9._\\-]*")); if(!encNameRegExp.exactMatch((yyvsp[(2) - (2)].sval))) { diff --git a/src/xmlpatterns/parser/querytransformparser.ypp b/src/xmlpatterns/parser/querytransformparser.ypp index 1814f28..d69868e 100644 --- a/src/xmlpatterns/parser/querytransformparser.ypp +++ b/src/xmlpatterns/parser/querytransformparser.ypp @@ -1470,7 +1470,7 @@ VersionDecl: /* empty */ Encoding: /* empty */ /* [X] */ | ENCODING StringLiteral { - const QRegExp encNameRegExp(QLatin1String("[A-Za-z][A-Za-z0-9._\\-]*")); + QRegExp encNameRegExp(QLatin1String("[A-Za-z][A-Za-z0-9._\\-]*")); if(!encNameRegExp.exactMatch($2)) { |