[REGEDIT]

- Prevent buffer overflow when creating the display value for a value of type REG_MULTI_SZ.
- Prevent processing excess data when preparing a value of type REG_MULTI_SZ for editing.

svn path=/trunk/; revision=54590
This commit is contained in:
Roel Messiant
2011-12-04 19:19:33 +00:00
parent 768046255e
commit c42d4ae0f0
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1127,7 +1127,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
size_t llen, listlen, nl_len;
LPTSTR src, lines = NULL;
if (!(stringValueData = HeapAlloc(GetProcessHeap(), 0, valueDataLen)))
if (!(stringValueData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, valueDataLen + sizeof(TCHAR))))
{
error(hwnd, IDS_TOO_BIG_VALUE, valueDataLen);
goto done;
+1 -1
View File
@@ -186,7 +186,7 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, void* ValB
if(dwCount >= 2)
{
src = (LPTSTR)ValBuf;
str = HeapAlloc(GetProcessHeap(), 0, dwCount);
str = HeapAlloc(GetProcessHeap(), 0, dwCount + sizeof(TCHAR));
if(str != NULL)
{
*str = _T('\0');