From: Volker Lendecke Date: Tue, 29 Sep 2020 08:20:41 +0000 (+0200) Subject: smbd: Use GUID_to_ndr_buf() in fsctl_validate_neg_info() X-Git-Tag: talloc-2.3.2~308 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f1161f441c74f09dd5af3954fc28b0d3534822e;p=thirdparty%2Fsamba.git smbd: Use GUID_to_ndr_buf() in fsctl_validate_neg_info() Avoid a talloc/free Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/smb2_ioctl_network_fs.c b/source3/smbd/smb2_ioctl_network_fs.c index f202cddd29c..e1881ae4485 100644 --- a/source3/smbd/smb2_ioctl_network_fs.c +++ b/source3/smbd/smb2_ioctl_network_fs.c @@ -443,7 +443,7 @@ static NTSTATUS fsctl_validate_neg_info(TALLOC_CTX *mem_ctx, uint16_t in_security_mode; uint16_t in_num_dialects; uint16_t dialect; - DATA_BLOB out_guid_blob; + struct GUID_ndr_buf out_guid_buf = { .buf = {0}, }; NTSTATUS status; enum protocol_types protocol = PROTOCOL_NONE; @@ -520,8 +520,7 @@ static NTSTATUS fsctl_validate_neg_info(TALLOC_CTX *mem_ctx, return NT_STATUS_ACCESS_DENIED; } - status = GUID_to_ndr_blob(&conn->smb2.server.guid, mem_ctx, - &out_guid_blob); + status = GUID_to_ndr_buf(&conn->smb2.server.guid, &out_guid_buf); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -532,7 +531,7 @@ static NTSTATUS fsctl_validate_neg_info(TALLOC_CTX *mem_ctx, } SIVAL(out_output->data, 0x00, conn->smb2.server.capabilities); - memcpy(out_output->data+0x04, out_guid_blob.data, 16); + memcpy(out_output->data+0x04, out_guid_buf.buf, 16); SSVAL(out_output->data, 0x14, conn->smb2.server.security_mode); SSVAL(out_output->data, 0x16, conn->smb2.server.dialect);