SampSetUserPassword: Fix check for vaild password hashes.

svn path=/trunk/; revision=59769
This commit is contained in:
Eric Kohl
2013-08-18 11:33:51 +00:00
parent 6356fb1d50
commit cb93ccc1d2
+6 -4
View File
@@ -402,12 +402,14 @@ SampSetUserPassword(IN PSAM_DB_OBJECT UserObject,
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)