From b00b678169103aa7ba550190a8ac884f39201c5a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 6 Sep 2011 14:14:52 +0200 Subject: [PATCH] s3:smb2_server: return OBJECT_NAME_INVALID if the path is terminated in SMB2_FIND/QUERY_DIRECTORY metze Autobuild-User: Stefan Metzmacher Autobuild-Date: Wed Sep 7 12:15:51 CEST 2011 on sn-devel-104 (cherry picked from commit 9bc4decc1cba701926fc8081c3903aac754a6f51) (cherry picked from commit fdb15df44a5ee4101b9e0c9bcdd07e48f6ce24fc) --- source3/smbd/smb2_find.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source3/smbd/smb2_find.c b/source3/smbd/smb2_find.c index 85e0126ac58..4a49f2a7a47 100644 --- a/source3/smbd/smb2_find.c +++ b/source3/smbd/smb2_find.c @@ -107,6 +107,14 @@ NTSTATUS smbd_smb2_request_process_find(struct smbd_smb2_request *req) return smbd_smb2_request_error(req, NT_STATUS_ILLEGAL_CHARACTER); } + if (in_file_name_buffer.length == 0) { + in_file_name_string_size = 0; + } + + if (strlen(in_file_name_string) != in_file_name_string_size) { + return smbd_smb2_request_error(req, NT_STATUS_OBJECT_NAME_INVALID); + } + if (req->compat_chain_fsp) { /* skip check */ } else if (in_file_id_persistent != in_file_id_volatile) { -- 2.11.4.GIT