forked from qt-creator/qt-creator
Debugger: Filter type names before looking them up
Change-Id: I55a705076c635d770c6c0c7cc467c1b30faf6e87 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -40,6 +40,8 @@
|
||||
#include <dbghelp.h>
|
||||
#endif
|
||||
|
||||
#include <regex>
|
||||
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user