Author: ekohl
Date: Sun Aug 18 11:33:51 2013
New Revision: 59769
URL:
http://svn.reactos.org/svn/reactos?rev=59769&view=rev
Log:
[SAMSRV]
SampSetUserPassword: Fix check for vaild password hashes.
Modified:
trunk/reactos/dll/win32/samsrv/user.c
Modified: trunk/reactos/dll/win32/samsrv/user.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/user.c?re…
==============================================================================
--- trunk/reactos/dll/win32/samsrv/user.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samsrv/user.c [iso-8859-1] Sun Aug 18 11:33:51 2013
@@ -402,12 +402,14 @@
NTSTATUS Status;
UseNtPassword =
- ((memcmp(NtPassword, &EmptyNtHash, sizeof(ENCRYPTED_NT_OWF_PASSWORD)) != 0)
&&
- (NtPasswordPresent != FALSE));
+ ((NtPasswordPresent != FALSE) &&
+ (NtPassword != NULL) &&
+ (memcmp(NtPassword, &EmptyNtHash, sizeof(ENCRYPTED_NT_OWF_PASSWORD)) != 0));
UseLmPassword =
- ((memcmp(LmPassword, &EmptyLmHash, sizeof(ENCRYPTED_LM_OWF_PASSWORD)) != 0)
&&
- (LmPasswordPresent != FALSE));
+ ((LmPasswordPresent != FALSE) &&
+ (LmPassword != NULL) &&
+ (memcmp(LmPassword, &EmptyLmHash, sizeof(ENCRYPTED_LM_OWF_PASSWORD)) != 0));
/* Update the NT password history only if we have a new non-empty NT password */
if (UseNtPassword)