From 6a22e8cb35cfccbacd65b56e193bf2ae83f205ea Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 24 Jun 2019 13:06:11 +0200 Subject: 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 --- sources/shiboken2/ApiExtractor/typesystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sources/shiboken2/ApiExtractor') 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? -- cgit v1.2.3