From: Volker Lendecke Date: Sat, 31 Dec 2016 12:45:51 +0000 (+0000) Subject: auth3: Use "all_zero" where appropriate X-Git-Tag: samba-4.6.0rc1~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f50b6e7cb4aa1891f4a6808cc7008f64aee79e49;p=thirdparty%2Fsamba.git auth3: Use "all_zero" where appropriate ... Saves a few bytes of footprint Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index 25f27e887d5..58639a0aba1 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -1358,8 +1358,6 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx, struct auth_serversupplied_info **server_info, const struct netr_SamInfo3 *info3) { - static const char zeros[16] = {0, }; - NTSTATUS nt_status = NT_STATUS_OK; char *found_username = NULL; const char *nt_domain; @@ -1460,7 +1458,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx, /* ensure we are never given NULL session keys */ - if (memcmp(info3->base.key.key, zeros, sizeof(zeros)) == 0) { + if (all_zero(info3->base.key.key, sizeof(info3->base.key.key))) { result->session_key = data_blob_null; } else { result->session_key = data_blob_talloc( @@ -1468,7 +1466,8 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx, sizeof(info3->base.key.key)); } - if (memcmp(info3->base.LMSessKey.key, zeros, 8) == 0) { + if (all_zero(info3->base.LMSessKey.key, + sizeof(info3->base.LMSessKey.key))) { result->lm_session_key = data_blob_null; } else { result->lm_session_key = data_blob_talloc(