Commit dd3c58c4 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

oleview: Fix bytecount for memmoves (Coverity).

parent 8b566b5e
...@@ -139,7 +139,7 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad ...@@ -139,7 +139,7 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
} }
else if(addings && !memcmp(wszName, wszProxyStubClsid32, sizeof(WCHAR[17]))) else if(addings && !memcmp(wszName, wszProxyStubClsid32, sizeof(WCHAR[17])))
{ {
lenData = sizeof(WCHAR[MAX_LOAD_STRING]); lenData = sizeof(wszData);
RegQueryValueW(hCurKey, NULL, wszData, (LONG *)&lenData); RegQueryValueW(hCurKey, NULL, wszData, (LONG *)&lenData);
RegCloseKey(hCurKey); RegCloseKey(hCurKey);
...@@ -155,7 +155,7 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad ...@@ -155,7 +155,7 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
RegCloseKey(hCurKey); RegCloseKey(hCurKey);
memmove(&wszData[6], wszData, lenData * sizeof(WCHAR)); memmove(&wszData[6], wszData, lenData);
memcpy(wszData, wszCLSID, sizeof(WCHAR[6])); memcpy(wszData, wszCLSID, sizeof(WCHAR[6]));
wszData[5] = '\\'; wszData[5] = '\\';
...@@ -183,7 +183,7 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad ...@@ -183,7 +183,7 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
RegCloseKey(hCurKey); RegCloseKey(hCurKey);
memmove(&wszData[8], wszData, lenData * sizeof(WCHAR)); memmove(&wszData[8], wszData, lenData);
memcpy(wszData, wszTypeLib, sizeof(WCHAR[8])); memcpy(wszData, wszTypeLib, sizeof(WCHAR[8]));
wszData[7] = '\\'; wszData[7] = '\\';
RegOpenKeyW(HKEY_CLASSES_ROOT, wszData, &hCurKey); RegOpenKeyW(HKEY_CLASSES_ROOT, wszData, &hCurKey);
...@@ -229,12 +229,11 @@ static void CreateReg(WCHAR *buffer) ...@@ -229,12 +229,11 @@ static void CreateReg(WCHAR *buffer)
*path = '\\'; *path = '\\';
path += 1; path += 1;
lenTree = sizeof(WCHAR[MAX_LOAD_STRING]); lenTree = sizeof(wszTree);
if(RegQueryValueW(hKey, NULL, wszTree, (LONG *)&lenTree) == ERROR_SUCCESS) if(RegQueryValueW(hKey, NULL, wszTree, (LONG *)&lenTree) == ERROR_SUCCESS)
{ {
memmove(&wszTree[lenBuffer-lastLenBuffer+3], wszTree, memmove(&wszTree[lenBuffer-lastLenBuffer+3], wszTree, lenTree);
lenTree * sizeof(WCHAR));
memcpy(wszTree, &buffer[lastLenBuffer], memcpy(wszTree, &buffer[lastLenBuffer],
(lenBuffer - lastLenBuffer) * sizeof(WCHAR)); (lenBuffer - lastLenBuffer) * sizeof(WCHAR));
......
Markdown is supported
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