Commit 4c3ca7ef authored by Friedemann Kleint's avatar Friedemann Kleint Committed by con
Browse files

Debugger[CDB]: Fix crash when printing large arrays.

Terminate string buffer correctly.

Reviewed-by: dt
Task-number: QTCREATORBUG-3271
parent 33d66233
......@@ -112,7 +112,7 @@ static inline QString getSymbolString(IDebugSymbolGroup2 *sg,
ULONG nameLength;
const HRESULT hr = (sg->*wsf)(index, nameBuffer, BufSize, &nameLength);
if (SUCCEEDED(hr)) {
nameBuffer[nameLength] = 0;
nameBuffer[qMin(nameLength, ULONG(BufSize))] = 0;
return QString::fromUtf16(reinterpret_cast<const ushort *>(nameBuffer));
return QString();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment