1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

libcli: Use GUID_to_ndr_buf() in smb2cli_validate_negotiate_info_send()

Avoid a talloc/free

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Oct  2 22:50:43 UTC 2020 on sn-devel-184
This commit is contained in:
Volker Lendecke
2020-09-29 10:55:07 +02:00
committed by Jeremy Allison
parent 63ab004e38
commit 666d2a38fc

View File

@ -5327,14 +5327,14 @@ struct tevent_req *smb2cli_validate_negotiate_info_send(TALLOC_CTX *mem_ctx,
}
if (state->conn->max_protocol >= PROTOCOL_SMB2_10) {
NTSTATUS status;
DATA_BLOB blob;
struct GUID_ndr_buf guid_buf = { .buf = {0}, };
status = GUID_to_ndr_blob(&conn->smb2.client.guid,
state, &blob);
status = GUID_to_ndr_buf(&conn->smb2.client.guid,
&guid_buf);
if (!NT_STATUS_IS_OK(status)) {
return NULL;
}
memcpy(buf+4, blob.data, 16); /* ClientGuid */
memcpy(buf+4, guid_buf.buf, 16); /* ClientGuid */
} else {
memset(buf+4, 0, 16); /* ClientGuid */
}