From e50a69334eaf6cadcf3ce93ab8b48e64c8940058 Mon Sep 17 00:00:00 2001 From: Jo Sutton Date: Thu, 18 Jan 2024 15:16:36 +1300 Subject: [PATCH] s4:dsdb: Remove unnecessary MIN() Since we have ensured that val->length >= sizeof(hash->hash), MIN(val->length, sizeof(hash->hash)) will here always be equal to sizeof(hash->hash). Signed-off-by: Jo Sutton Reviewed-by: Martin Schwenke --- source4/dsdb/common/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 868ce432719..757133eb277 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -539,7 +539,7 @@ struct samr_Password *samdb_result_hash(TALLOC_CTX *mem_ctx, const struct ldb_me return NULL; } talloc_keep_secret(hash); - memcpy(hash->hash, val->data, MIN(val->length, sizeof(hash->hash))); + memcpy(hash->hash, val->data, sizeof(hash->hash)); } return hash; }