summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2016-11-25 10:18:06 +0100
committerDavid Schulz <david.schulz@qt.io>2016-11-28 11:07:24 +0000
commita91dce13ba5dad88f8fa9bf6dc66946b271cc9de (patch)
tree346b3943a871bf985dfac7efb44ba496f245c3a5 /src
parent037888217484e3c915d32133b9a1b8684a63ee56 (diff)
downloadqt-creator-a91dce13ba5dad88f8fa9bf6dc66946b271cc9de.tar.gz
Debugger: Do not add values for indices out of bounds
Change-Id: Ifa3dcade9939df095a2dc46bcdf49cb37906d95f Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/libs/qtcreatorcdbext/pyvalue.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libs/qtcreatorcdbext/pyvalue.cpp b/src/libs/qtcreatorcdbext/pyvalue.cpp
index 26380493f7..bb0b643223 100644
--- a/src/libs/qtcreatorcdbext/pyvalue.cpp
+++ b/src/libs/qtcreatorcdbext/pyvalue.cpp
@@ -327,6 +327,12 @@ void initValue(Value *value)
PyObject *createValue(ULONG index, CIDebugSymbolGroup *symbolGroup)
{
+ ULONG count;
+ if (FAILED(symbolGroup->GetNumberSymbols(&count)))
+ Py_RETURN_NONE;
+ if (index >= count) // don't add values for indices out of bounds
+ Py_RETURN_NONE;
+
Value *value = PyObject_New(Value, value_pytype());
if (value != NULL) {
value->m_index = index;