add a NULL pointer check

See issue #2508 for more details.

svn path=/trunk/; revision=28050
This commit is contained in:
Christoph von Wittich 2007-07-30 21:04:38 +00:00
parent cb9cf60a0d
commit b430b691ac
2 changed files with 5 additions and 2 deletions

View file

@ -512,7 +512,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
HKEY hRootKey;
HKEY hKey = NULL;
LPNMTVDISPINFO ptvdi;
LONG lResult;
LONG lResult = ERROR_SUCCESS;
TCHAR szBuffer[MAX_PATH];
ptvdi = (LPNMTVDISPINFO) lParam;
@ -531,7 +531,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
{
lResult = RegRenameKey(hRootKey, keyPath, ptvdi->item.pszText);
}
return lResult == ERROR_SUCCESS;
return lResult;
}
}
default:

View file

@ -1606,6 +1606,9 @@ LONG RegRenameKey(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpNewName)
LPTSTR lpNewSubKey = NULL;
LONG Ret = 0;
if (!lpSubKey)
return Ret;
s = _tcsrchr(lpSubKey, _T('\\'));
if (s)
{