libcli:auth: Avoid explicit ZERO_STRUCT
authorAndreas Schneider <asn@samba.org>
Fri, 26 Oct 2018 12:50:29 +0000 (14:50 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 27 Feb 2019 02:22:50 +0000 (03:22 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Feb 27 03:22:50 CET 2019 on sn-devel-144

libcli/auth/credentials.c

index b6c8ba281bab491e815c4be76c8d574c18c5c74f..fcd5e34cc9b4f2a56f54ecefa00ab53f12607701 100644 (file)
@@ -76,14 +76,12 @@ static void netlogon_creds_init_128bit(struct netlogon_creds_CredentialState *cr
                                       const struct netr_Credential *server_challenge,
                                       const struct samr_Password *machine_password)
 {
-       unsigned char zero[4], tmp[16];
+       uint8_t zero[4] = {0}, tmp[16];
        HMACMD5Context ctx;
        MD5_CTX md5;
 
        ZERO_ARRAY(creds->session_key);
 
-       memset(zero, 0, sizeof(zero));
-
        hmac_md5_init_rfc2104(machine_password->hash, sizeof(machine_password->hash), &ctx);
        MD5Init(&md5);
        MD5Update(&md5, zero, sizeof(zero));