aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-06-24 13:06:11 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-06-24 13:08:37 +0200
commit6a22e8cb35cfccbacd65b56e193bf2ae83f205ea (patch)
treeee73f64df26eace2b5386e2e93e8ab31d2e4a4d4
parent9693ff297b00c6b6c13d77a5b704275e9808fa18 (diff)
shiboken: Fix out of bounds string access
Fix warning: (shiboken) Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt. introduced by qtbase/c2d2757bccc68e1b981df059786c2e76f2969530 (5.14). This happens when endPos is modified by the prior call to parseType(). Change-Id: I3b81e674c0aa118bd003aa25d8c61d89d772366f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--sources/shiboken2/ApiExtractor/typesystem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/shiboken2/ApiExtractor/typesystem.cpp b/sources/shiboken2/ApiExtractor/typesystem.cpp
index 344313e87..b4c94695d 100644
--- a/sources/shiboken2/ApiExtractor/typesystem.cpp
+++ b/sources/shiboken2/ApiExtractor/typesystem.cpp
@@ -3384,7 +3384,7 @@ AddedFunction::AddedFunction(QString signature, const QString &returnType) :
if (!arg.name.isEmpty())
m_arguments.append({argumentName, arg});
// end of parameters...
- if (signature[endPos] == QLatin1Char(')'))
+ if (endPos >= signatureLength || signature[endPos] == QLatin1Char(')'))
break;
}
// is const?