]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
rpc_server: Slightly simplify set_user_info_18()
authorVolker Lendecke <vl@samba.org>
Tue, 17 Aug 2021 18:18:45 +0000 (20:18 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 24 Aug 2021 17:32:28 +0000 (17:32 +0000)
Instead of adding the NULL check to data_blob_talloc_zero() put "out"
on the stack.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/rpc_server/samr/srv_samr_nt.c

index b4c72d901b37f3eea4993edf6266d91e0de3ce1f..14eeaa5cec5723ab1de3d7abf46be2ff3306530a 100644 (file)
@@ -4622,11 +4622,9 @@ static NTSTATUS set_user_info_18(struct samr_UserInfo18 *id18,
        }
 
        if (id18->nt_pwd_active) {
-
-               DATA_BLOB in, out;
-
-               in = data_blob_const(id18->nt_pwd.hash, 16);
-               out = data_blob_talloc_zero(mem_ctx, 16);
+               DATA_BLOB in = data_blob_const(id18->nt_pwd.hash, 16);
+               uint8_t outbuf[16] = { 0, };
+               DATA_BLOB out = data_blob_const(outbuf, sizeof(outbuf));
 
                rc = sess_crypt_blob(&out, &in, session_key, SAMBA_GNUTLS_DECRYPT);
                if (rc != 0) {
@@ -4642,11 +4640,9 @@ static NTSTATUS set_user_info_18(struct samr_UserInfo18 *id18,
        }
 
        if (id18->lm_pwd_active) {
-
-               DATA_BLOB in, out;
-
-               in = data_blob_const(id18->lm_pwd.hash, 16);
-               out = data_blob_talloc_zero(mem_ctx, 16);
+               DATA_BLOB in = data_blob_const(id18->lm_pwd.hash, 16);
+               uint8_t outbuf[16] = { 0, };
+               DATA_BLOB out = data_blob_const(outbuf, sizeof(outbuf));
 
                rc = sess_crypt_blob(&out, &in, session_key, SAMBA_GNUTLS_DECRYPT);
                if (rc != 0) {