summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/smb2cli_query_directory.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/libsmb/smb2cli_query_directory.c b/source3/libsmb/smb2cli_query_directory.c
index 2286f2ce6f..4a0e69b534 100644
--- a/source3/libsmb/smb2cli_query_directory.c
+++ b/source3/libsmb/smb2cli_query_directory.c
@@ -59,12 +59,17 @@ struct tevent_req *smb2cli_query_directory_send(TALLOC_CTX *mem_ctx,
}
if (!convert_string_talloc(state, CH_UNIX, CH_UTF16,
- mask, strlen(mask)+1,
+ mask, strlen(mask),
&dyn, &dyn_len)) {
tevent_req_oom(req);
return tevent_req_post(req, ev);
}
+ if (strlen(mask) == 0) {
+ TALLOC_FREE(dyn);
+ dyn_len = 0;
+ }
+
fixed = state->fixed;
SSVAL(fixed, 0, 33);
SCVAL(fixed, 2, level);