Author: cwittich
Date: Tue Jul 31 01:04:38 2007
New Revision: 28050
URL:
http://svn.reactos.org/svn/reactos?rev=28050&view=rev
Log:
add a NULL pointer check
See issue #2508 for more details.
Modified:
trunk/reactos/base/applications/regedit/childwnd.c
trunk/reactos/base/applications/regedit/regproc.c
Modified: trunk/reactos/base/applications/regedit/childwnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
==============================================================================
--- trunk/reactos/base/applications/regedit/childwnd.c (original)
+++ trunk/reactos/base/applications/regedit/childwnd.c Tue Jul 31 01:04:38 2007
@@ -512,7 +512,7 @@
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 = RegRenameKey(hRootKey, keyPath, ptvdi->item.pszText);
}
- return lResult == ERROR_SUCCESS;
+ return lResult;
}
}
default:
Modified: trunk/reactos/base/applications/regedit/regproc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
==============================================================================
--- trunk/reactos/base/applications/regedit/regproc.c (original)
+++ trunk/reactos/base/applications/regedit/regproc.c Tue Jul 31 01:04:38 2007
@@ -1606,6 +1606,9 @@
LPTSTR lpNewSubKey = NULL;
LONG Ret = 0;
+ if (!lpSubKey)
+ return Ret;
+
s = _tcsrchr(lpSubKey, _T('\\'));
if (s)
{