diff options
author | Andrew Bartlett <abartlet@samba.org> | 2022-03-31 21:22:08 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2022-05-05 01:19:54 +0000 |
commit | 7a36b01888995031d00dbdba208fc9f522658f86 (patch) | |
tree | 847aa29d537ae92b5c25e1caa57d91bb0179c8d3 /source4/dsdb | |
parent | 2f17cbf3b295663a91e4facb0dc8f09ef4a77f4a (diff) | |
download | samba-7a36b01888995031d00dbdba208fc9f522658f86.tar.gz |
dsdb: Do not reuse "ret" variable as return code and for memcmp() comparison
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu May 5 01:19:54 UTC 2022 on sn-devel-184
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/password_hash.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index f9eccd9c10b..faf8a35818f 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -2842,8 +2842,8 @@ static int check_password_restrictions(struct setup_password_fields_io *io, WERR /* checks the NT hash password history */ for (i = 0; i < io->o.nt_history_len; i++) { - ret = memcmp(io->n.nt_hash, io->o.nt_history[i].hash, 16); - if (ret == 0) { + int pw_cmp = memcmp(io->n.nt_hash, io->o.nt_history[i].hash, 16); + if (pw_cmp == 0) { ret = LDB_ERR_CONSTRAINT_VIOLATION; *werror = WERR_PASSWORD_RESTRICTION; ldb_asprintf_errstring(ldb, |