From: Igor Kulaychuk Date: Tue, 11 Jul 2017 20:15:37 +0000 (+0300) Subject: Fix field name length conversion X-Git-Tag: submit/tizen/20180620.071641~224 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9e07291887f34b6706f07271c7080a70b17f2f6d;p=sdk%2Ftools%2Fnetcoredbg.git Fix field name length conversion --- diff --git a/src/debug/debugger/valuewalk.cpp b/src/debug/debugger/valuewalk.cpp index 765874f..3319b7c 100644 --- a/src/debug/debugger/valuewalk.cpp +++ b/src/debug/debugger/valuewalk.cpp @@ -235,9 +235,9 @@ static HRESULT WalkMembers(ICorDebugValue *pInputValue, ICorDebugILFrame *pILFra ULONG nameLen = 0; DWORD fieldAttr = 0; WCHAR mdName[mdNameLen] = {0}; - if(SUCCEEDED(pMD->GetFieldProps(fieldDef, NULL, mdName, mdNameLen, &nameLen, &fieldAttr, NULL, NULL, NULL, NULL, NULL))) + if(SUCCEEDED(pMD->GetFieldProps(fieldDef, NULL, mdName, _countof(mdName), &nameLen, &fieldAttr, NULL, NULL, NULL, NULL, NULL))) { - std::string name = to_utf8(mdName, nameLen); + std::string name = to_utf8(mdName /*, nameLen*/); if(fieldAttr & fdLiteral) continue; @@ -258,7 +258,7 @@ static HRESULT WalkMembers(ICorDebugValue *pInputValue, ICorDebugILFrame *pILFra pObjValue->GetFieldValue(pClass, fieldDef, &pFieldVal); } - if(pFieldVal != NULL) + if (pFieldVal != NULL) { if (name[0] == '<') {