diff --git a/src/libs/qtcreatorcdbext/pytype.cpp b/src/libs/qtcreatorcdbext/pytype.cpp index 2525a65114e..38bb73bc0f0 100644 --- a/src/libs/qtcreatorcdbext/pytype.cpp +++ b/src/libs/qtcreatorcdbext/pytype.cpp @@ -40,6 +40,8 @@ #include #endif +#include + constexpr bool debugPyType = false; constexpr bool debuggingTypeEnabled() { return debugPyType || debugPyCdbextModule; } @@ -411,6 +413,10 @@ PyType PyType::lookupType(const std::string &typeNameIn, ULONG64 module) if (typeName == "__int64" || typeName == "unsigned __int64") typeName.erase(typeName.find("__"), 2); + const static std::regex typeNameRE("^[a-zA-Z_][a-zA-Z0-9_]*!?[a-zA-Z0-9_<>:, \\*\\&\\[\\]]*$"); + if (!std::regex_match(typeName, typeNameRE)) + return PyType(); + CIDebugSymbols *symbols = ExtensionCommandContext::instance()->symbols(); ULONG typeId; HRESULT result = S_FALSE;