1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

libcli: Use GUID_to_ndr_buf() in smbXcli_negprot_smb2_subreq()

Avoid a talloc/free

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2020-09-29 10:53:42 +02:00 committed by Jeremy Allison
parent 39180ca2d8
commit 63ab004e38

View File

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