From: Jo Sutton Date: Thu, 18 Jan 2024 02:16:36 +0000 (+1300) Subject: s4:dsdb: Remove unnecessary MIN() X-Git-Tag: tdb-1.4.11~221 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e50a69334eaf6cadcf3ce93ab8b48e64c8940058;p=thirdparty%2Fsamba.git 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 --- 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; }